"use client"; import { useRef } from "react"; import { Dialog, DialogContent, DialogOverlay, DialogTitle, } from "@/components/ui/dialog"; import { api } from "@/lib/trpc"; import * as VisuallyHidden from "@radix-ui/react-visually-hidden"; import { Loader2, X } from "lucide-react"; import { ShareButton } from "./ShareButton"; import { WrappedContent } from "./WrappedContent"; interface WrappedModalProps { open: boolean; onClose: () => void; } export function WrappedModal({ open, onClose }: WrappedModalProps) { const contentRef = useRef(null); const { data: stats, isLoading } = api.users.wrapped.useQuery(undefined, { enabled: open, }); const { data: whoami } = api.users.whoami.useQuery(undefined, { enabled: open, }); return ( Your 2025 Wrapped
{/* Share button overlay */} {stats && !isLoading && } {/* Close button overlay */}
{/* Content */} {isLoading ? (

Loading your Wrapped...

) : stats ? ( ) : (

Failed to load your Wrapped stats

)}
); }