import { useState } from 'react'; import { Type } from 'lucide-react'; export type DirectoryFont = 'C64_Pro_Mono' | 'CbmShift'; const FONTS: { id: DirectoryFont; label: string }[] = [ { id: 'C64_Pro_Mono', label: 'C64 Pro' }, { id: 'CbmShift', label: 'CBM Shift' }, ]; export interface DirectoryEntry { blocks: number; name: string; type: string; } interface DirectoryListingProps { entries: DirectoryEntry[]; footerNote?: string; } const TYPE_BADGE: Record = { PRG: 'bg-blue-100 text-blue-700', SEQ: 'bg-green-100 text-green-700', DEL: 'bg-neutral-200 text-neutral-500', REL: 'bg-purple-100 text-purple-700', USR: 'bg-orange-100 text-orange-700', }; export default function DirectoryListing({ entries, footerNote }: DirectoryListingProps) { const [font, setFont] = useState('C64_Pro_Mono'); return (
{/* Font toggle bar */}
Font:
{FONTS.map((f, idx) => ( ))}
{/* Listing */}
{entries.length === 0 ? (
Empty directory
) : ( entries.map((entry, idx) => (
{String(entry.blocks).padStart(3, ' ')} {entry.name} {entry.type}
)) )}
{footerNote && (
{footerNote}
)}
); }