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 '@/shared/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 inlineActive = variant === 'inline'; const [inlineMounted, setInlineMounted] = React.useState(false); const [inlineVisible, setInlineVisible] = React.useState(false); React.useEffect(() => { if (!inlineActive) { setInlineMounted(false); setInlineVisible(false); return; } if (open) { setInlineMounted(true); const frame = window.requestAnimationFrame(() => setInlineVisible(true)); return () => window.cancelAnimationFrame(frame); } setInlineVisible(false); const timer = window.setTimeout(() => setInlineMounted(false), 260); return () => window.clearTimeout(timer); }, [inlineActive, open]); const content = ( {t('share.title', 'Shared photo')} {photoId ? ( #{photoId} ) : null} {eventName ? ( {eventName} ) : null} {url ?? ' '} ); if (inlineActive) { if (!inlineMounted && !open) { return null; } return (