import { useEffect } from 'react'; import { Avatar, Box, Table, TableContainer, Tbody, Td, Text, Th, Thead, Tr, Wrap, WrapItem } from '@chakra-ui/react'; import { addNewFile, selectFiles } from './fileListingSlice'; import { useAppDispatch, useAppSelector } from '../../hooks'; export function FileListing() { const dispatch = useAppDispatch(); const files = useAppSelector(selectFiles); useEffect(() => { // FIXME: Remove test data if (Object.keys(files).length === 0) { dispatch(addNewFile({ id: 'dummy', fileName: '测试文件名.mgg', blobURI: '' })); } }, []); return ( {Object.entries(files).map(([id, file]) => ( ))}
封面 元信息 操作
{file.metadata.cover && } {!file.metadata.cover && 暂无封面} {file.metadata.name || file.fileName} 专辑: {file.metadata.album} 艺术家: {file.metadata.artist} 专辑艺术家: {file.metadata.albumArtist} 播放 下载 删除
); }