import { IngredientBox, IngredientItem } from "../types"; import { ItemTypeIcons } from "./utils"; const styles = { paneHeader: { fontSize: "1.1em", fontWeight: "bold", marginBottom: 15, }, paneContainer: { height: "100%", padding: 10, }, rowItemContainer: { display: "flex", justifyContent: "space-between", alignItems: "center", margin: "3px 0", }, rowItemRight: { display: "flex", alignItems: "center", }, }; /** Displays a single ingredient item's name, type and value */ const IngredientPaneRow = ({ name, item, }: { name: string; item: IngredientItem; }) => { return (
{name} {item.value == null ? "-" : item.value.toString()} {ItemTypeIcons[item.type]}
); }; /** Displays list of ingredients under an "Ingredients" header */ export const IngredientsPane = ({ box }: { box: IngredientBox }) => { return (
Ingredients
{Object.keys(box).map((name) => ( ))}
); };