chore: address code review re file row

This commit is contained in:
鲁树人 2023-05-21 14:17:55 +01:00
parent c0bc9858d0
commit 4b7ed90247

View File

@ -18,7 +18,7 @@ import {
import { DecryptedAudioFile, deleteFile, ProcessState } from './fileListingSlice'; import { DecryptedAudioFile, deleteFile, ProcessState } from './fileListingSlice';
import { useCallback, useRef } from 'react'; import { useCallback, useRef } from 'react';
import { useAppDispatch } from '~/hooks'; import { useAppDispatch } from '~/hooks';
import coverSvgUrl from '~/assets/no-cover.svg'; import noCoverFallbackImageURL from '~/assets/no-cover.svg';
interface FileRowProps { interface FileRowProps {
id: string; id: string;
@ -86,9 +86,8 @@ export function FileRow({ id, file }: FileRowProps) {
<Center w="160px" h="160px" m="auto"> <Center w="160px" h="160px" m="auto">
<Image <Image
objectFit="cover" objectFit="cover"
src={metadata?.cover} src={metadata?.cover || noCoverFallbackImageURL}
alt={`${metadata?.album} 的专辑封面`} alt={`${metadata?.album} 的专辑封面`}
fallbackSrc={coverSvgUrl}
/> />
</Center> </Center>
</GridItem> </GridItem>