{"size": 662, "ext": "js", "max_stars_repo_path": "src/components/KegDetail.js", "max_stars_repo_name": "DanielAdeyemi/tap_room_2", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/KegDetail.js", "max_issues_repo_name": "DanielAdeyemi/tap_room_2", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/KegDetail.js", "max_forks_repo_name": "DanielAdeyemi/tap_room_2", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.0666666667, "max_line_length": 74, "alphanum_fraction": 0.5951661631}
import React from "react";
import PropTypes from "prop-types";

const KegDetail = (props) => {
  const { keg } = props;
  let { message } = props;
  if(keg.kegLeftover <= 0) {
    message = "Out of stock";
  } else if (keg.kegLeftover <= 20) {
    message = "*Low Stock!*";
  }
  return (
		<>
			<h2>About {keg.kegName}</h2>
			<h3>Brand: {keg.kegBrand}</h3>
			<p>Contains: {keg.kegAlcohol}% of Alcohol</p>
			<p>
				<b>Price for pint: </b> ${keg.kegPrice}
			</p>
			<p><b><i>{message}</i></b> Amount left(in pints): {keg.kegLeftover}</p>
		</>
	);
}

KegDetail.propTypes = {
  keg: PropTypes.object, 
  message: PropTypes.string
}

export default KegDetail;