{"size": 1449, "ext": "js", "max_stars_repo_path": "src/components/meal_planner/InfoCard.js", "max_stars_repo_name": "Alicekb/audreyII-frontend", "max_stars_repo_stars_event_min_datetime": "2018-09-05T23:50:46.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-24T20:23:28.000Z", "max_issues_repo_path": "src/components/meal_planner/InfoCard.js", "max_issues_repo_name": "Alicekb/audreyII-frontend", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/meal_planner/InfoCard.js", "max_forks_repo_name": "Alicekb/audreyII-frontend", "max_forks_repo_forks_event_min_datetime": "2018-05-15T20:54:51.000Z", "max_forks_repo_forks_event_max_datetime": "2018-05-15T20:54:51.000Z"}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 22.640625, "max_line_length": 75, "alphanum_fraction": 0.4582470669}
import React from 'react'
import { Grid, Segment, Header, Button, List } from 'semantic-ui-react'

const InfoCard = ({
  name,
  ingredients,
  calories,
  recipe,
  removable,
  handleDelete
}) =>
  <Segment>
    <Grid style={{ padding: '1em' }}>
      <Grid.Row columns={2}>
        <Grid.Column>
          <Header as="h3" floated="left">
            Ingredients List:
          </Header>
        </Grid.Column>
        {removable
          ? <Grid.Column>
              <Button floated="right" onClick={() => handleDelete(name)}>
                Delete
              </Button>
            </Grid.Column>
          : null}
      </Grid.Row>

      <Grid.Row>
        <List celled horizontal>
          {ingredients}
        </List>
      </Grid.Row>

      <Grid.Row style={{ padding: 0 }}>
        <List horizontal>
          <Header as="h3" floated="left">
            Calories:
          </Header>
          <List.Item>
            {calories}
          </List.Item>
        </List>
      </Grid.Row>

      <Grid.Row style={{ padding: 0 }}>
        <List>
          <Header as="h3" floated="left">
            Recipe URL:
          </Header>
          <List.Item>
            {recipe !== ''
              ? <a href={recipe} target="_blank" rel="noopener noreferrer">
                  {recipe}
                </a>
              : null}
          </List.Item>
        </List>
      </Grid.Row>
    </Grid>
  </Segment>

export default InfoCard
