Device Name
{
const path = getDevicePath();
updateDeviceSetting([...path, 'name'], e.target.value);
}}
className="w-full px-3 py-2 border border-neutral-300 rounded-lg"
/>
Type
{device.type.charAt(0).toUpperCase() + device.type.slice(1)}
Enabled
{
const path = getDevicePath();
updateDeviceSetting([...path, 'enabled'], deviceData.enabled ? 0 : 1);
}}
className={`relative w-12 h-6 rounded-full transition-colors ${
deviceData.enabled ? 'bg-blue-600' : 'bg-neutral-300'
}`}
>
{deviceData.url !== undefined && (
URL
{
const path = getDevicePath();
updateDeviceSetting([...path, 'url'], e.target.value);
}}
className="flex-1 px-3 py-2 border border-neutral-300 rounded-lg"
/>
setShowFileBrowser(true)}
className="px-3 py-2 border border-neutral-300 rounded-lg bg-neutral-50 hover:bg-neutral-100"
>
{mediaSet && (
Media Set
{mediaSet.files.slice(0, 5).map((file, index) => {
// Attempt to extract a title from the filename, fallback to filename
// Example: /path/to/Game Disk.d64 or /path/to/disk1.d64
const fileName = file.split('/').pop() || file;
// If you have a title mapping, replace this logic
const title = fileName.replace(/\.[^.]+$/, '');
return (
switchMedia(index)}
className={`px-3 py-1.5 rounded-lg text-sm ${
deviceData.url === file
? 'bg-blue-600 text-white'
: 'bg-neutral-100 text-neutral-700 hover:bg-neutral-200'
}`}
>
{`${index + 1}: ${title}`}
);
})}
)}
)}
{deviceData.mode !== undefined && (
Mode
{
const path = getDevicePath();
updateDeviceSetting([...path, 'mode'], parseInt(e.target.value));
}}
className="w-full px-3 py-2 border border-neutral-300 rounded-lg"
/>
)}
{deviceData.type && (
Device Type
{deviceData.type}
)}
{deviceData.baud !== undefined && (
Baud Rate
{
const path = getDevicePath();
updateDeviceSetting([...path, 'baud'], parseInt(e.target.value));
}}
className="w-full px-3 py-2 border border-neutral-300 rounded-lg"
/>
)}