"use client"; /** * The sticker drawer, opened from the composer. * * The collection is whatever the server says it is — rewards earned through * sādhana plus stickers saved from a chat — so a sticker you were sent * appears here the moment you keep it, with no client-side bookkeeping. * * Empty is a real state worth explaining: stickers are earned, so someone * with none needs to know how to get one rather than seeing a blank sheet. */ import { useEffect, useState } from "react"; import Image from "next/image"; import { ResponsiveDialog } from "@/components/chat/responsive-dialog"; import { chat, type Sticker } from "@/lib/chat"; export function StickerPicker({ onPick, onClose, }: { onPick: (sticker: Sticker) => void; onClose: () => void; }) { const [stickers, setStickers] = useState(null); useEffect(() => { let cancelled = false; chat .stickers() .then((s) => { if (!cancelled) setStickers(s); }) .catch(() => { if (!cancelled) setStickers([]); }); return () => { cancelled = true; }; }, []); return ( {stickers === null ? (

Loading…

) : stickers.length === 0 ? (

No stickers yet. Keep your sādhana streak — a sacred reward arrives every 7 days — or save one someone sends you.

) : (
{stickers.map((s) => ( ))}
)}
); }