"use client"; import { Shuffle } from "lucide-react"; import { useTranslations } from "next-intl"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import { GRADIENT_OPTIONS, DISH_ICON_OPTIONS, DRINK_ICON_OPTIONS } from "@/lib/recipe-placeholder"; /** Lets the user pin a specific color + icon for a recipe's cover placeholder, * used whenever there's no uploaded photo. Leaving both unset (null) keeps * the automatic per-recipe pick from getRecipePlaceholder. */ export function RecipeCoverPicker({ recipeType, color, icon, onChange, }: { recipeType: "dish" | "drink"; color: string | null; icon: string | null; onChange: (next: { color: string | null; icon: string | null }) => void; }) { const t = useTranslations("recipeForm"); const iconOptions = recipeType === "drink" ? DRINK_ICON_OPTIONS : DISH_ICON_OPTIONS; return (

{t("coverHint")}

{(color || icon) && ( )}
{GRADIENT_OPTIONS.map((g) => (
{iconOptions.map(({ key, Icon }) => ( ))}
); }