import React from 'react'; import { XStack } from '@tamagui/stacks'; import { SizableText as Text } from '@tamagui/text'; import { Button } from '@tamagui/button'; import { Bell, Settings } from 'lucide-react'; import { DEFAULT_EVENT_BRANDING, useOptionalEventBranding } from '@/guest/context/EventBrandingContext'; import EventLogo from './EventLogo'; import { useGuestThemeVariant } from '../lib/guestTheme'; type TopBarProps = { eventName: string; eventIcon?: string | null; onProfilePress?: () => void; onNotificationsPress?: () => void; notificationCount?: number; }; export default function TopBar({ eventName, eventIcon, onProfilePress, onNotificationsPress, notificationCount = 0, }: TopBarProps) { const { isDark } = useGuestThemeVariant(); const brandingContext = useOptionalEventBranding(); const branding = brandingContext?.branding ?? DEFAULT_EVENT_BRANDING; const logoPosition = branding.logo?.position ?? 'left'; const [animationKey, setAnimationKey] = React.useState(0); React.useEffect(() => { setAnimationKey((prev) => prev + 1); }, [eventName]); const identityDirection = logoPosition === 'right' ? 'row-reverse' : logoPosition === 'center' ? 'column' : 'row'; const identityAlign = logoPosition === 'center' ? 'center' : 'flex-start'; return ( {eventName} ); }