"use client"; import { useRouter } from "next/navigation"; import { useTranslations } from "next-intl"; import { ChefHat } from "lucide-react"; import { Button } from "@/components/ui/button"; import { useLocale } from "@/lib/i18n/provider"; import { MarkCookedDialog } from "./mark-cooked-dialog"; export function MarkCookedSection({ recipeId, baseServings, cookCount, lastCookedAt, }: { recipeId: string; baseServings: number; cookCount: number; lastCookedAt: string | null; }) { const t = useTranslations("recipe"); const router = useRouter(); const { locale } = useLocale(); return (
{cookCount === 1 ? t("markCookedCountSingular") : t("markCookedCountPlural", { count: cookCount })} {lastCookedAt && t("markCookedLast", { date: new Date(lastCookedAt).toLocaleDateString(locale, { month: "short", day: "numeric" }) })}
)}