import { Trash2 } from 'lucide-react'; import { TRASH_RETENTION_DAYS } from '@family-wishlist/shared'; import { WishCard } from '@/components/WishCard/WishCard'; import { useRestoreWish, useWishes } from '@/features/wishes/wishes.hooks'; import { daysLeftUntil } from '@/lib/format'; export function TrashPage() { const { data, isLoading } = useWishes('deleted'); const restore = useRestoreWish(); return (

Trash

Deleted wishes are kept for {TRASH_RETENTION_DAYS} days, then permanently removed.

{isLoading &&
Loading...
} {!isLoading && data && data.length === 0 && (

Trash is empty

Deleted wishes will appear here for 30 days.

)} {data && data.length > 0 && (
{data.map((wish) => { const left = wish.deletedAt ? daysLeftUntil(wish.deletedAt, TRASH_RETENTION_DAYS) : TRASH_RETENTION_DAYS; return ( restore.mutate(wish.id)} footer={

Auto-removes in {left} day{left === 1 ? '' : 's'}

} /> ); })}
)}
); }