"use client"; import { useTranslations } from "next-intl"; import Link from "next/link"; import { ShoppingCart } from "lucide-react"; import { NewShoppingListButton } from "@/components/meal-plan/new-shopping-list-button"; type ShoppingListItem = { id: string; name: string; generatedAt: string | null; totalItems: number; checkedItems: number; }; type Props = { lists: ShoppingListItem[]; }; export function ShoppingListsPageContent({ lists }: Props) { const t = useTranslations("shoppingLists"); return (

{t("title")}

{t("subtitle")}

{lists.length === 0 ? (

{t("empty")}

) : (
{lists.map((list) => (

{list.name}

{list.totalItems === 0 ? t("listEmpty") : t("items", { checked: list.checkedItems, total: list.totalItems })} {list.generatedAt && ` · ${t("generated")}`}

{list.totalItems === 0 ? "—" : `${Math.round((list.checkedItems / list.totalItems) * 100)}%`}
))}
)}
); }