feat(frontend): add react spa with wishlist flows and public profile

This commit is contained in:
Anton
2026-04-23 16:05:27 +03:00
parent 5f6a551b6c
commit 00f01611ed
44 changed files with 2166 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
import { WishCard } from '@/components/WishCard/WishCard';
import {
useDeleteWish,
useRestoreWish,
useWishes,
} from '@/features/wishes/wishes.hooks';
import { Archive } from 'lucide-react';
export function ArchivePage() {
const { data, isLoading } = useWishes('archived');
const restore = useRestoreWish();
const remove = useDeleteWish();
return (
<div className="grid gap-6">
<section>
<h1 className="font-display text-3xl">Archive</h1>
<p className="text-sm text-muted">
Wishes you put aside. Only you see this. Restore them to your active list any time.
</p>
</section>
{isLoading && <div className="text-muted">Loading...</div>}
{!isLoading && data && data.length === 0 && (
<div className="flex flex-col items-center gap-2 rounded-xl border border-border bg-surface/80 p-10 text-center shadow-card">
<Archive className="h-10 w-10 text-muted" />
<h2 className="text-xl font-semibold">Archive is empty</h2>
<p className="text-sm text-muted">Archived wishes will show up here.</p>
</div>
)}
{data && data.length > 0 && (
<div className="grid gap-5 sm:grid-cols-2 lg:grid-cols-3">
{data.map((wish) => (
<WishCard
key={wish.id}
wish={wish}
view="owner"
onRestore={() => restore.mutate(wish.id)}
onDelete={() => remove.mutate(wish.id)}
/>
))}
</div>
)}
</div>
);
}