import React from 'react'; import { getCurrentWindow } from '@tauri-apps/api/window'; import { Minus, Square, X } from 'lucide-react'; import { usePlayerStore } from '../store/playerStore'; import { useAuthStore } from '../store/authStore'; import { IS_MACOS } from '../utils/platform'; export default function TitleBar() { const win = getCurrentWindow(); const currentTrack = usePlayerStore(s => s.currentTrack); const isPlaying = usePlayerStore(s => s.isPlaying); const windowButtonStyle = useAuthStore(s => s.windowButtonStyle); const showMinimizeButton = useAuthStore(s => s.showMinimizeButton); return (
{/* macOS drops the now-playing label: subpixel antialiasing is disabled in the Overlay title-bar zone, so small text renders frayed. The bar stays a clean themed strip with the native traffic lights (#1198); the track is already shown in the player bar. */} {!IS_MACOS && (
{currentTrack && ( <> {isPlaying ? '▶' : '⏸'} {currentTrack.artist && `${currentTrack.artist} – `}{currentTrack.title} )}
)} {/* macOS keeps its native traffic lights (floating over the bar via titleBarStyle: Overlay); only Linux draws in-page window buttons. */} {!IS_MACOS && (
{showMinimizeButton && ( )}
)}
); }