From e6b3c2813ddd1361a32e650f6416442fb1d3d7fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E6=A0=91=E4=BA=BA?= Date: Sun, 21 May 2023 18:19:41 +0100 Subject: [PATCH] feat: move metadata display component out from FileRow --- src/features/file-listing/FileRow.tsx | 20 +++----------------- src/features/file-listing/SongMetadata.tsx | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 17 deletions(-) create mode 100644 src/features/file-listing/SongMetadata.tsx diff --git a/src/features/file-listing/FileRow.tsx b/src/features/file-listing/FileRow.tsx index c280c8c..91d60d4 100644 --- a/src/features/file-listing/FileRow.tsx +++ b/src/features/file-listing/FileRow.tsx @@ -7,17 +7,17 @@ import { Collapse, GridItem, Link, - Text, - useDisclosure, VStack, Wrap, WrapItem, + useDisclosure, } from '@chakra-ui/react'; import { FileRowResponsiveGrid } from './FileRowResponsiveGrid'; import { DecryptedAudioFile, deleteFile, ProcessState } from './fileListingSlice'; import { useAppDispatch } from '~/hooks'; import { AnimationDefinition } from 'framer-motion'; import { AlbumImage } from './AlbumImage'; +import { SongMetadata } from './SongMetadata'; interface FileRowProps { id: string; @@ -73,21 +73,7 @@ export function FileRow({ id, file }: FileRowProps) { {metadata?.name ?? nameWithoutExt} - - {isDecrypted && metadata && ( - - - 专辑: {metadata.album} - - - 艺术家: {metadata.artist} - - - 专辑艺术家: {metadata.albumArtist} - - - )} - + {isDecrypted && metadata && } {file.decrypted &&