code refactoring
This commit is contained in:
@@ -22,8 +22,10 @@ import {
|
||||
} from '@mui/material'
|
||||
|
||||
import DeleteForeverIcon from '@mui/icons-material/DeleteForever'
|
||||
import VideoFileIcon from '@mui/icons-material/VideoFile'
|
||||
import FolderIcon from '@mui/icons-material/Folder'
|
||||
import InsertDriveFileIcon from '@mui/icons-material/InsertDriveFile'
|
||||
import VideoFileIcon from '@mui/icons-material/VideoFile'
|
||||
|
||||
import { Buffer } from 'buffer'
|
||||
import { useEffect, useMemo, useState, useTransition } from 'react'
|
||||
import { useSelector } from 'react-redux'
|
||||
@@ -174,7 +176,9 @@ export default function Downloaded() {
|
||||
<ListItemIcon>
|
||||
{file.isDirectory
|
||||
? <FolderIcon />
|
||||
: <VideoFileIcon />
|
||||
: file.isVideo
|
||||
? <VideoFileIcon />
|
||||
: <InsertDriveFileIcon />
|
||||
}
|
||||
</ListItemIcon>
|
||||
<ListItemText primary={file.name} />
|
||||
|
||||
9
frontend/src/types/index.d.ts
vendored
9
frontend/src/types/index.d.ts
vendored
@@ -66,10 +66,15 @@ export type DirectoryEntry = {
|
||||
name: string
|
||||
path: string
|
||||
shaSum: string
|
||||
isVideo: boolean,
|
||||
isDirectory: boolean
|
||||
}
|
||||
|
||||
export type DeleteRequest = Omit<DirectoryEntry, 'name' | 'isDirectory'>
|
||||
export type DeleteRequest = Omit<
|
||||
DirectoryEntry, 'name' | 'isDirectory' | 'isVideo'
|
||||
>
|
||||
|
||||
export type PlayRequest = Omit<DirectoryEntry, 'shaSum' | 'name' | 'isDirectory'>
|
||||
export type PlayRequest = Omit<
|
||||
DirectoryEntry, 'shaSum' | 'name' | 'isDirectory' | 'isVideo'
|
||||
>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user