feat(MediaManager): add support for 'doc' view mode and corresponding icon
This commit is contained in:
parent
f9103455ed
commit
658495be3d
|
|
@ -40,6 +40,7 @@ import {
|
|||
Trash2,
|
||||
Upload,
|
||||
X,
|
||||
Book,
|
||||
} from 'lucide-react';
|
||||
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
|
||||
import { vscDarkPlus } from 'react-syntax-highlighter/dist/esm/styles/prism';
|
||||
|
|
@ -155,6 +156,7 @@ function ViewerModeIcon({ mode, className }: { mode: ViewMode; className?: strin
|
|||
case 'hex': return <Hash className={cls} />;
|
||||
case 'image': return <ImageIcon className={cls} />;
|
||||
case 'config': return <SlidersHorizontal className={cls} />;
|
||||
case 'doc': return <Book className={cls} />;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -624,6 +626,7 @@ export default function MediaManager({ initialPath = '/', rootPath, title, confi
|
|||
if (renameEntry !== null) return;
|
||||
if (entry.type === 'folder') { navigateTo(joinPath(path, entry.name)); return; }
|
||||
const targetMode = mode ?? defaultViewMode(entry);
|
||||
if (targetMode === 'doc') { window.open(getWebDAVBaseUrl() + entry.path, '_blank'); return; }
|
||||
setViewEntry(entry);
|
||||
setViewMode(targetMode);
|
||||
setViewText(null);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user