"use client"; import { useState } from "react"; 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"; import { ShoppingListActionsMenu } from "@/components/shopping-lists/shopping-list-actions-menu"; import { EmptyState } from "@/components/shared/empty-state"; 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: initialLists, sharedLists = [] }: Props) { const t = useTranslations("shoppingLists"); const ts = useTranslations("shareDialog"); const [lists, setLists] = useState(initialLists); return (
{t("subtitle")}
{list.totalItems === 0 ? t("listEmpty") : t("items", { checked: list.checkedItems, total: list.totalItems })} {list.generatedAt && ` · ${t("generated")}`}
{list.ownerName} · {ts(list.role)}