"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 SharedListItem = { id: string; name: string; ownerName: string; role: "viewer" | "editor"; }; type Props = { lists: ShoppingListItem[]; sharedLists?: SharedListItem[]; }; export function ShoppingListsPageContent({ lists, sharedLists = [] }: 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)}%`}
))}
)} {sharedLists.length > 0 && (

Shared with you

{sharedLists.map((list) => (

{list.name}

{list.ownerName} · {list.role}

))}
)}
); }