import { useState } from 'react'; import { Cable, Code2, Cpu, FolderOpen, Link, List, Zap } from 'lucide-react'; import MediaBrowser from './MediaBrowser'; interface IECPageProps { config: any; setConfig: (config: any) => void; } export default function IECPage({ config, setConfig }: IECPageProps) { const [showMediaBrowser, setShowMediaBrowser] = useState(false); const [driveRomBrowsingKey, setDriveRomBrowsingKey] = useState(null); const updateSetting = (path: string[], value: any) => { const newConfig = JSON.parse(JSON.stringify(config)); let current = newConfig; for (let i = 0; i < path.length - 1; i++) { current = current[path[i]]; } current[path[path.length - 1]] = value; setConfig(newConfig); }; const iec = config.iec || {}; return (

IEC Settings

updateSetting(['iec', 'boot_disk'], e.target.value)} className="flex-1 px-3 py-2 border border-neutral-300 rounded-lg" />
{showMediaBrowser && ( { updateSetting(['iec', 'boot_disk'], path); setShowMediaBrowser(false); }} onClose={() => setShowMediaBrowser(false)} /> )}

Drive ROMs

{(['default', 'd64', 'd71', 'd81'] as const).map((key) => (
updateSetting(['iec', 'drive_rom', key], e.target.value)} className="flex-1 px-3 py-2 border border-neutral-300 rounded-lg" />
))}
{driveRomBrowsingKey && ( { updateSetting(['iec', 'drive_rom', driveRomBrowsingKey], path); setDriveRomBrowsingKey(null); }} onClose={() => setDriveRomBrowsingKey(null)} /> )}

Directory Settings

{Object.entries(iec.directory || {}).map(([key, value]) => (
{typeof value === 'number' ? ( ) : ( updateSetting(['iec', 'directory', key], parseInt(e.target.value))} className="w-24 px-3 py-1 border border-neutral-300 rounded-lg text-right" /> )}
))}

Hardware Fastloaders

Serial

{Object.entries(iec.fastloaders?.hardware?.serial || {}).map(([key, value]) => (
))}

Parallel

{Object.entries(iec.fastloaders?.hardware?.parallel || {}).map(([key, value]) => (
))}

Software Fastloaders

{Object.entries(iec.fastloaders?.software || {}).map(([key, value]) => (
))}

Chainloaders

{Object.entries(iec.chainloaders || {}).map(([key, value]) => (
))}
); }