Applied consistent code formatting across the project using Prettier, now configured to use 4-space indentation instead of tabs.
51 lines
1.3 KiB
TypeScript
51 lines
1.3 KiB
TypeScript
import type { key_str } from './ae_utils';
|
|
|
|
// Updated 2024-06-19
|
|
export function file_extension_icon(extension: string) {
|
|
// console.log('*** file_extension_icon() ***');
|
|
const file_icons: key_str = {
|
|
file: 'file',
|
|
'3gp': 'file-video',
|
|
'7z': 'file-archive',
|
|
aac: 'file-audio',
|
|
ac3: 'file-audio',
|
|
aif: 'file-audio',
|
|
aiff: 'file-audio',
|
|
avi: 'file-video',
|
|
bmp: 'file-image',
|
|
csv: 'file-csv',
|
|
doc: 'file-word',
|
|
docx: 'file-word',
|
|
eps: 'file-image',
|
|
flac: 'file-audio',
|
|
gif: 'file-image',
|
|
htm: 'file-code',
|
|
html: 'file-code',
|
|
jpeg: 'file-image',
|
|
jpg: 'file-image',
|
|
key: 'file-powerpoint',
|
|
mkv: 'file-video',
|
|
mov: 'file-video',
|
|
mp3: 'file-audio',
|
|
mp4: 'file-video',
|
|
odp: 'file-powerpoint',
|
|
pdf: 'file-pdf',
|
|
png: 'file-image',
|
|
ppt: 'file-powerpoint',
|
|
pptx: 'file-powerpoint',
|
|
txt: 'file-alt',
|
|
wav: 'file-audio',
|
|
webp: 'file-image',
|
|
xls: 'file-excel',
|
|
xlsx: 'file-excel',
|
|
zip: 'file-archive'
|
|
};
|
|
|
|
if (file_icons[extension]) {
|
|
return file_icons[extension];
|
|
} else {
|
|
// return null;
|
|
return file_icons['file'];
|
|
}
|
|
}
|