add flags to help to decide file icon

This commit is contained in:
myl7
2022-01-24 16:03:35 +08:00
parent d3d69849c9
commit a53c0ab985
3 changed files with 13 additions and 5 deletions
+2 -2
View File
@@ -58,7 +58,7 @@ const queryToPath = (query?: ParsedUrlQuery) => {
}
const FileListItem: FC<{
fileContent: { id: string; name: string; size: number; file: Object; lastModifiedDateTime: string }
fileContent: { id: string; name: string; size: number; file: Object; lastModifiedDateTime: string, video: any }
}> = ({ fileContent: c }) => {
const emojiIcon = emojiRegex().exec(c.name)
const renderEmoji = emojiIcon && !emojiIcon.index
@@ -71,7 +71,7 @@ const FileListItem: FC<{
{renderEmoji ? (
<span>{emojiIcon ? emojiIcon[0] : '📁'}</span>
) : (
<FontAwesomeIcon icon={c.file ? getFileIcon(c.name) : ['far', 'folder']} />
<FontAwesomeIcon icon={c.file ? getFileIcon(c.name, { video: Boolean(c.video) }) : ['far', 'folder']} />
)}
</div>
<div className="truncate">