Skip to content

Commit

Permalink
Fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
MQ-xz committed Jul 12, 2023
1 parent 6b8880f commit a661921
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/utils/getFileIcon.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default function getFileIcon(filename) {
const fileExtension = filename.split('.').reverse()[0]
const fileExtension = filename.split(".").reverse()[0];

if (fileTypesMap.image.includes(fileExtension)) {
return iconsMap.image;
Expand All @@ -24,18 +24,18 @@ export default function getFileIcon(filename) {
}

const iconsMap = {
image: 'https://img.icons8.com/fluency/48/image.png',
audio: 'https://img.icons8.com/color/48/audio-file.png',
video: 'https://img.icons8.com/color/48/cinema---v1.png',
document: 'https://img.icons8.com/color/48/document--v1.png',
archive: 'https://img.icons8.com/color/48/archive.png',
misc: 'https://img.icons8.com/color/48/file.png'
}
image: "https://img.icons8.com/fluency/48/image.png",
audio: "https://img.icons8.com/color/48/audio-file.png",
video: "https://img.icons8.com/color/48/cinema---v1.png",
document: "https://img.icons8.com/color/48/document--v1.png",
archive: "https://img.icons8.com/color/48/archive.png",
misc: "https://img.icons8.com/color/48/file.png",
};

const fileTypesMap = {
image: ['png', 'jpg', 'jpeg', 'gif', 'webp'],
audio: ['mp3', 'aac', 'wav'],
video: ['mp4', 'webm', 'mkv'],
document: ['pdf', 'doc', 'xls', 'xlsx'],
archive: ['iso', 'zip', 'rar', 'tar', 'tar.gz']
}
image: ["png", "jpg", "jpeg", "gif", "webp"],
audio: ["mp3", "aac", "wav"],
video: ["mp4", "webm", "mkv"],
document: ["pdf", "doc", "xls", "xlsx"],
archive: ["iso", "zip", "rar", "tar", "tar.gz"],
};

0 comments on commit a661921

Please sign in to comment.