import type { IngredientView } from "@batch-cooking/shared"; import { useTranslation } from "react-i18next"; import { AllergenBadges } from "./AllergenBadges"; import { DietBadges } from "./DietBadges"; import { ReproducibleBadge } from "./ReproducibleBadge"; import { IngredientTypeIcon } from "./ingredient-icons"; import "./recipes.scss"; /** One selected ingredient line in the recipe form — the ingredient itself (picked via `IngredientPicker`) plus its quantity/unit for this recipe. Quantity/unit are kept as raw strings while editing (not parsed to a number until submit) so an in-progress/invalid value doesn't fight the input. */ export function IngredientRow({ ingredient, quantity, unit, onQuantityChange, onUnitChange, onRemove, }: { ingredient: IngredientView; quantity: string; unit: string; onQuantityChange: (quantity: string) => void; onUnitChange: (unit: string) => void; onRemove: () => void; }) { const { t } = useTranslation(); return (