Fix pinned icons, add bulk download, add media metadata
Some checks failed
Automated Container Build / build-and-push (push) Has been cancelled
Some checks failed
Automated Container Build / build-and-push (push) Has been cancelled
This commit is contained in:
parent
2b49e90b81
commit
ed5cc79c25
6 changed files with 182 additions and 18 deletions
|
|
@ -788,7 +788,7 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) {
|
|||
|
||||
if (ext === 'pdf') {
|
||||
return (
|
||||
<div className={`${large ? 'w-20 h-20 rounded-2xl text-2xl' : 'w-6 h-6 rounded text-[8px]'} flex items-center justify-center font-black tracking-tighter shadow-sm text-white bg-[#ea4335]`}>
|
||||
<div className={`${large ? 'w-20 h-20 rounded-2xl text-2xl' : 'w-5 h-5 rounded text-[6px]'} flex items-center justify-center font-black tracking-tighter shadow-sm text-white bg-[#ea4335]`}>
|
||||
PDF
|
||||
</div>
|
||||
);
|
||||
|
|
@ -797,40 +797,40 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) {
|
|||
const fallbackIcon = (() => {
|
||||
if (isImage) {
|
||||
return (
|
||||
<div className={`${large ? 'w-20 h-20 rounded-2xl' : 'w-6 h-6 rounded'} flex items-center justify-center shadow-sm text-white bg-[#3b82f6]`}>
|
||||
<ImageIcon className={large ? "w-10 h-10 text-white" : "w-3.5 h-3.5 text-white"} />
|
||||
<div className={`${large ? 'w-20 h-20 rounded-2xl' : 'w-5 h-5 rounded'} flex items-center justify-center shadow-sm text-white bg-[#3b82f6]`}>
|
||||
<ImageIcon className={large ? "w-10 h-10 text-white" : "w-3 h-3 text-white"} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (isVideo) {
|
||||
return (
|
||||
<div className={`${large ? 'w-20 h-20 rounded-2xl' : 'w-6 h-6 rounded'} flex items-center justify-center shadow-sm text-white bg-[#a855f7]`}>
|
||||
<FilmIcon className={large ? "w-10 h-10 text-white" : "w-3.5 h-3.5 text-white"} />
|
||||
<div className={`${large ? 'w-20 h-20 rounded-2xl' : 'w-5 h-5 rounded'} flex items-center justify-center shadow-sm text-white bg-[#a855f7]`}>
|
||||
<FilmIcon className={large ? "w-10 h-10 text-white" : "w-3 h-3 text-white"} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (['mp3', 'wav', 'flac', 'ogg', 'm4a'].includes(ext)) {
|
||||
return (
|
||||
<div className={`${large ? 'w-20 h-20 rounded-2xl' : 'w-6 h-6 rounded'} flex items-center justify-center shadow-sm text-white bg-[#ec4899]`}>
|
||||
<MusicIcon className={large ? "w-10 h-10 text-white" : "w-3.5 h-3.5 text-white"} />
|
||||
<div className={`${large ? 'w-20 h-20 rounded-2xl' : 'w-5 h-5 rounded'} flex items-center justify-center shadow-sm text-white bg-[#ec4899]`}>
|
||||
<MusicIcon className={large ? "w-10 h-10 text-white" : "w-3 h-3 text-white"} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (['js', 'ts', 'jsx', 'tsx', 'py', 'go', 'rs', 'java', 'c', 'cpp', 'html', 'css', 'json'].includes(ext)) {
|
||||
return (
|
||||
<div className={`${large ? 'w-20 h-20 rounded-2xl' : 'w-6 h-6 rounded'} flex items-center justify-center shadow-sm text-white bg-[#f59e0b]`}>
|
||||
<CodeIcon className={large ? "w-10 h-10 text-white" : "w-3.5 h-3.5 text-white"} />
|
||||
<div className={`${large ? 'w-20 h-20 rounded-2xl' : 'w-5 h-5 rounded'} flex items-center justify-center shadow-sm text-white bg-[#f59e0b]`}>
|
||||
<CodeIcon className={large ? "w-10 h-10 text-white" : "w-3 h-3 text-white"} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (['zip', 'tar', 'gz', 'rar', '7z'].includes(ext)) {
|
||||
return (
|
||||
<div className={`${large ? 'w-20 h-20 rounded-2xl' : 'w-6 h-6 rounded'} flex items-center justify-center shadow-sm text-white bg-[#14b8a6]`}>
|
||||
<ArchiveIcon className={large ? "w-10 h-10 text-white" : "w-3.5 h-3.5 text-white"} />
|
||||
<div className={`${large ? 'w-20 h-20 rounded-2xl' : 'w-5 h-5 rounded'} flex items-center justify-center shadow-sm text-white bg-[#14b8a6]`}>
|
||||
<ArchiveIcon className={large ? "w-10 h-10 text-white" : "w-3 h-3 text-white"} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1545,8 +1545,23 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) {
|
|||
className="p-2 hover:bg-white/5 rounded-lg transition-colors flex items-center gap-2 text-sm"
|
||||
style={{ color: 'var(--color-text-primary)' }}
|
||||
onClick={() => {
|
||||
// In a real app, this would trigger a bulk download zip
|
||||
alert('Bulk download not implemented yet');
|
||||
const form = document.createElement('form');
|
||||
form.method = 'POST';
|
||||
form.action = api.getBulkDownloadUrl();
|
||||
form.target = '_blank';
|
||||
|
||||
Array.from(selectedFiles).forEach(path => {
|
||||
const input = document.createElement('input');
|
||||
input.type = 'hidden';
|
||||
input.name = 'paths';
|
||||
input.value = path;
|
||||
form.appendChild(input);
|
||||
});
|
||||
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
document.body.removeChild(form);
|
||||
setSelectedFiles(new Set());
|
||||
}}
|
||||
>
|
||||
<Download className="w-4 h-4" />
|
||||
|
|
|
|||
Reference in a new issue