import React from 'react'; import { YStack, XStack } from '@tamagui/stacks'; import { SizableText as Text } from '@tamagui/text'; import { Button } from '@tamagui/button'; import { ScrollView } from '@tamagui/scroll-view'; import { X } from 'lucide-react'; import { useOptionalNotificationCenter } from '@/guest/context/NotificationCenterContext'; import { useTranslation } from '@/guest/i18n/useTranslation'; import { useGuestThemeVariant } from '../lib/guestTheme'; type NotificationSheetProps = { open: boolean; onOpenChange: (open: boolean) => void; }; export default function NotificationSheet({ open, onOpenChange }: NotificationSheetProps) { const { t } = useTranslation(); const center = useOptionalNotificationCenter(); const { isDark } = useGuestThemeVariant(); const mutedButton = isDark ? 'rgba(248, 250, 255, 0.08)' : 'rgba(15, 23, 42, 0.06)'; const mutedButtonBorder = isDark ? 'rgba(248, 250, 255, 0.2)' : 'rgba(15, 23, 42, 0.12)'; const notifications = center?.notifications ?? []; const unreadCount = center?.unreadCount ?? 0; const uploadCount = (center?.queueCount ?? 0) + (center?.pendingCount ?? 0); return ( <> onOpenChange(false)} onClick={() => onOpenChange(false)} onMouseDown={() => onOpenChange(false)} onTouchStart={() => onOpenChange(false)} /> {t('header.notifications.title', 'Updates')} {unreadCount > 0 ? t('header.notifications.unread', { count: unreadCount }, '{count} neu') : t('header.notifications.allRead', 'Alles gelesen')} {center ? ( ) : null} {center?.loading ? ( {t('common.actions.loading', 'Loading...')} ) : notifications.length === 0 ? ( {t('header.notifications.emptyUnread', 'Du bist auf dem neuesten Stand!')} {t('header.notifications.emptyStatus', 'Keine Upload-Hinweise oder Wartungen aktiv.')} ) : ( {notifications.map((item) => ( {item.title} {item.body ? ( {item.body} ) : null} ))} )} ); } function InfoBadge({ label, value }: { label: string; value: number }) { const { isDark } = useGuestThemeVariant(); return ( {label} {value} ); }