-
- {pathParts.map((part, index) => (
-
+
+ {pathParts.map((part, i) => (
+
-
+
))}
@@ -327,155 +149,77 @@ export default function MediaBrowser({ currentPath, onSelect, onClose }: MediaBr
{path === null && (
-
- Resolving location…
+ Resolving location…
)}
-
{loading && (
-
- Loading…
+ Loading…
)}
-
{!loading && error && (
Failed to load directory
{error}
-
)}
-
{!loading && !error && path !== null && (
<>
{path !== '/' && (
-
-
+
+
..
)}
-
- {entries.map((entry) => (
- (
+
- {
- if (entry.type === 'folder') {
- navigateToFolder(entry.name);
- } else {
- selectEntry(entry);
- }
- }}
- className="flex-1 flex items-center gap-3 text-left min-w-0"
- >
-
-
-
{entry.name}
- {entry.type === 'file' && (
-
- {humanFileSize(entry.size)}
- {entry.lastModified
- ? ` · ${entry.lastModified.toLocaleDateString()}`
- : ''}
-
- )}
-
- {entry.type === 'folder' && (
-
- )}
-
- {
- e.stopPropagation();
- setActionEntry(entry);
- }}
- className="p-2 rounded hover:bg-neutral-100"
- aria-label={`Actions for ${entry.name}`}
- title="Actions"
- >
-
-
-
+ entry={entry}
+ onPrimaryClick={() => entry.type === 'folder' ? navigateToFolder(entry.name) : selectEntry(entry)}
+ onActionsClick={e => { e.stopPropagation(); setActionEntry(entry); }}
+ />
))}
-
- {entries.length === 0 && (
-
- Empty folder
-
- )}
+ {entries.length === 0 && Empty folder
}
>
)}
-
-
- Select Folder: {path ?? '/'}
+
+ Select Folder: {path ?? '/'}