fix(MediaEntry): add support for comic file types in EntryIcon

This commit is contained in:
Jaime Idolpx 2026-06-13 02:34:02 -04:00
parent 421a667548
commit cb33268dcc

View File

@ -1,4 +1,5 @@
import { import {
Album,
BookOpen, BookOpen,
Braces, Braces,
CassetteTape, CassetteTape,
@ -12,6 +13,7 @@ import {
Folder, Folder,
HardDrive, HardDrive,
Image as ImageIcon, Image as ImageIcon,
BookImage,
Layers, Layers,
MoreVertical, MoreVertical,
Music, Music,
@ -39,6 +41,7 @@ export const DISK_EXTS = new Set(['c64', 'd41', 'd64', 'd67', 'd71', 'd80', '
export const DISC_EXTS = new Set(['iso', 'img', 'cue']); export const DISC_EXTS = new Set(['iso', 'img', 'cue']);
export const HD_EXTS = new Set(['d1m', 'd2m', 'd4m', 'd90', 'dhd', 'hdd', 'bbt', 'd8b', 'dfi']); export const HD_EXTS = new Set(['d1m', 'd2m', 'd4m', 'd90', 'dhd', 'hdd', 'bbt', 'd8b', 'dfi']);
export const ARCHIVE_EXTS = new Set(['zip', '7z', 'tar', 'gz', 'bz2', 'xz', 'rar', 'arj', 'lzh', 'ace', 'z', 'lha', 'cab', 'lbr', 'arc', 'ark', 'lnx']); export const ARCHIVE_EXTS = new Set(['zip', '7z', 'tar', 'gz', 'bz2', 'xz', 'rar', 'arj', 'lzh', 'ace', 'z', 'lha', 'cab', 'lbr', 'arc', 'ark', 'lnx']);
export const COMIC_EXTS = new Set(['cbz', 'cbr', 'cb7', 'cbt', 'cbz']);
export const CONFIG_EXTS = new Set(['config']); export const CONFIG_EXTS = new Set(['config']);
// ─── EntryIcon ──────────────────────────────────────────────────────────────── // ─── EntryIcon ────────────────────────────────────────────────────────────────
@ -62,6 +65,7 @@ export function EntryIcon({ entry }: { entry: EntryInfo }) {
if (DOC_EXTS.has(ext)) return <FileType className="w-5 h-5 text-blue-400 flex-shrink-0" />; if (DOC_EXTS.has(ext)) return <FileType className="w-5 h-5 text-blue-400 flex-shrink-0" />;
if (CODE_EXTS.has(ext)) return <Terminal className="w-5 h-5 text-green-600 flex-shrink-0" />; if (CODE_EXTS.has(ext)) return <Terminal className="w-5 h-5 text-green-600 flex-shrink-0" />;
if (TEXT_EXTS.has(ext)) return <FileText className="w-5 h-5 text-green-600 flex-shrink-0" />; if (TEXT_EXTS.has(ext)) return <FileText className="w-5 h-5 text-green-600 flex-shrink-0" />;
if (COMIC_EXTS.has(ext)) return <BookImage className="w-5 h-5 text-pink-500 flex-shrink-0" />;
return <File className="w-5 h-5 text-neutral-400 flex-shrink-0" />; return <File className="w-5 h-5 text-neutral-400 flex-shrink-0" />;
} }