import { Reorder, useDragControls } from "motion/react"; import type { RecipeIngredientSection } from "../../types/recipe"; import DeleteIconSmall from "../icons/DeleteIconSmall"; import DragIconSmall from "../icons/DragIconSmall"; import type { ReactNode } from "react"; interface IngredientSectionProps { section: RecipeIngredientSection; onChange: (id: string, name: string) => void; removeIngredientSectionHandler: (id: string) => void; allowDelete: boolean; children?: ReactNode; }; export default function IngredientSection({ section, onChange, removeIngredientSectionHandler, allowDelete, children }: IngredientSectionProps) { const controls = useDragControls(); return (

Group:

onChange(section.Id, e.target.value)} placeholder="Group label" className="mx-2 px-2 py-1 border border-gray-300 flex-grow rounded-sm min-w-1" />
{ e.preventDefault(); controls.start(e); }} >
{children}
); }