feat(MediaManager): enhance viewer options for SVG files in availableViewers function

This commit is contained in:
Jaime Idolpx 2026-06-09 15:56:56 -04:00
parent 1d2690efa4
commit c0d45e33f0

View File

@ -92,8 +92,9 @@ function defaultViewMode(entry: EntryInfo): ViewMode {
function availableViewers(entry: EntryInfo): ViewMode[] {
const def = defaultViewMode(entry);
const ext = entry.name.split('.').pop()?.toLowerCase() ?? '';
const map: Record<ViewMode, ViewMode[]> = {
image: ['image', 'hex'],
image: ext === 'svg' ? ['image', 'xml', 'hex'] : ['image', 'hex'],
config: ['config', 'text', 'hex'],
markdown: ['markdown', 'text', 'hex'],
json: ['json', 'text', 'hex'],