import React from 'react'; import { Sheet } from '@tamagui/sheet'; import { YStack, XStack } from '@tamagui/stacks'; import { SizableText as Text } from '@tamagui/text'; import { Button } from '@tamagui/button'; import { Share2, MessageSquare, Copy, X } from 'lucide-react'; import { useTranslation } from '@/guest/i18n/useTranslation'; import { useGuestThemeVariant } from '../lib/guestTheme'; type ShareSheetProps = { open: boolean; onOpenChange: (open: boolean) => void; photoId?: number | null; eventName?: string | null; url?: string | null; loading?: boolean; variant?: 'modal' | 'inline'; onShareNative: () => void; onShareWhatsApp: () => void; onShareMessages: () => void; onCopyLink: () => void; }; const WhatsAppIcon = (props: React.SVGProps) => ( ); export default function ShareSheet({ open, onOpenChange, photoId, eventName, url, loading = false, variant = 'modal', onShareNative, onShareWhatsApp, onShareMessages, onCopyLink, }: ShareSheetProps) { const { t } = useTranslation(); const { isDark } = useGuestThemeVariant(); const mutedSurface = isDark ? 'rgba(255, 255, 255, 0.08)' : 'rgba(15, 23, 42, 0.06)'; const mutedBorder = isDark ? 'rgba(255, 255, 255, 0.2)' : 'rgba(15, 23, 42, 0.12)'; const [inlineMounted, setInlineMounted] = React.useState(false); const [inlineVisible, setInlineVisible] = React.useState(false); React.useEffect(() => { if (variant !== 'inline') return; if (open) { setInlineMounted(true); const raf = window.requestAnimationFrame(() => { setInlineVisible(true); }); return () => window.cancelAnimationFrame(raf); } setInlineVisible(false); const timeout = window.setTimeout(() => { setInlineMounted(false); }, 220); return () => window.clearTimeout(timeout); }, [open, variant]); const content = ( {t('share.title', 'Shared photo')} {photoId ? ( #{photoId} ) : null} {eventName ? ( {eventName} ) : null} {url ? ( {url} ) : null} ); if (variant === 'inline') { if (!inlineMounted) { return null; } return (