import { X, Play } from 'lucide-react'; import { useQuery } from '@tanstack/react-query'; import { Link } from '@tanstack/react-router'; import type { AlbumWithTracks, ArtistWithAlbums } from '../types'; import { albumService } from '../services/albumService'; import { artistService } from '../services/artistService'; import { Artwork } from './Artwork'; import { Button } from './ethos/Button'; import { TrackRow } from './TrackRow'; import { usePlaybackStore } from '../store/usePlaybackStore'; type InspectorMode = 'album' | 'artist' | 'track'; interface InspectorProps { mode: InspectorMode; id: string; onClose: () => void; } function AlbumInspector({ id, onClose }: { id: string; onClose: () => void }) { const { setQueue, playTrack } = usePlaybackStore(); const { data, isLoading } = useQuery({ queryKey: ['album', id], queryFn: () => albumService.getAlbum(id), }); if (isLoading) { return (
); } if (!data) return null; const tracks = data.tracks ?? []; return (
{/* Header */}
Album
{/* Artwork + meta */}

{data.title}

{data.artist_name || 'Unknown artist'}{data.year ? ` · ${data.year}` : ''}

{tracks.length} tracks

{/* Track list */}
Tracks
{tracks.map((t, i) => ( ))}
); } function ArtistInspector({ id, onClose }: { id: string; onClose: () => void }) { const { data, isLoading } = useQuery({ queryKey: ['artist', id], queryFn: () => artistService.getArtist(id), }); if (isLoading) { return (
); } if (!data) return null; const albums = data.albums ?? []; return (
Artist

{data.name}

{albums.length} albums

{albums.length > 0 && (
Albums
{albums.map((album) => (
{album.title} ))}
)}
); } export type { InspectorMode }; /** * Inspector panel — right-side detail view for albums, artists, and tracks. * Replaces full-page navigations with a slide-in panel per Ethos conventions. */ export function Inspector({ mode, id, onClose }: InspectorProps) { return ( ); }