import { useState } from 'react'; import { AppShell, Group, ActionIcon, rem, Button, Select, Title, Image, Tooltip, } from '@mantine/core'; import { Settings, ArrowLeft, CircleFadingArrowUp } from 'lucide-react'; import { soundAssets, playSound, initializeAudio } from '@/utils/sounds'; import { useAppUpdateChecker } from '@/hooks/useAppUpdateChecker'; import iconUrl from '/icon.png'; import { FRONTENDS } from '@/constants'; import type { InterfaceTab, FrontendPreference, Screen } from '@/types'; interface AppHeaderProps { currentScreen: Screen | null; activeInterfaceTab: InterfaceTab; setActiveInterfaceTab: (tab: InterfaceTab) => void; isImageGenerationMode: boolean; frontendPreference: FrontendPreference; onEject: () => void; onSettingsOpen: () => void; } export const AppHeader = ({ currentScreen, activeInterfaceTab, setActiveInterfaceTab, isImageGenerationMode, frontendPreference, onEject, onSettingsOpen, }: AppHeaderProps) => { const [logoClickCount, setLogoClickCount] = useState(0); const [isElephantMode, setIsElephantMode] = useState(false); const [isMouseSqueaking, setIsMouseSqueaking] = useState(false); const { hasUpdate, openReleasePage } = useAppUpdateChecker(); const handleLogoClick = async () => { await initializeAudio(); setLogoClickCount((prev) => prev + 1); try { if (logoClickCount >= 10 && Math.random() < 0.1) { setIsElephantMode(true); await playSound(soundAssets.elephant, 0.6); setTimeout(() => { setIsElephantMode(false); }, 1500); } else { setIsMouseSqueaking(true); const squeakNumber = Math.floor(Math.random() * 5); await playSound(soundAssets.mouseSqueaks[squeakNumber], 0.4); setTimeout(() => { setIsMouseSqueaking(false); }, 300); } } catch { void 0; } }; return (
{currentScreen === 'interface' ? ( ) : ( Gerbil Gerbil )}
{currentScreen === 'interface' && (