'use client'; import { AlertTriangle, Heart, ShoppingCart, X } from 'lucide-react'; import { Link, SmartLink } from '@/core/lib/navigation'; import { useWishlistPage } from '@/core/hooks/use-wishlist-page'; import { ProductGrid } from '@/ui/product/product-grid'; import { Button } from '@/components/ui/button'; import { Skeleton } from '@/components/ui/skeleton'; import { useTranslations } from '@/core/lib/translations'; /** * The wishlist page: the shopper's saved products, newest first. * * Same four-state pattern as the cart page. `status` decides what to draw: * loading a skeleton, never a spinner and never the empty state * error the list could not be loaded: says so, with a way out. NEVER drawn as empty * empty the ONLY state that says "nothing saved yet" * ready the products, through the shared ProductGrid (each card keeps its heart, so * tapping it takes the product off the list) * * A guest's list is in this browser only, and the page says so in a line that does not * block anything. */ export function WishlistView() { const t = useTranslations('wishlist'); const { status, products, isMember, retry, canAddToCart, addAllToCart, addingAll, addAllResult, dismissAddAllResult, } = useWishlistPage(); if (status === 'loading') { return (
{t('loadErrorBody')}
{t('emptySubtitle')}
{countLabel}
{t('guestNote')}{' '}
{resultText}