feat: 即使不存在歌曲元数据,也展示默认的“暂无封面”占位图片
This commit is contained in:
parent
4341203c08
commit
aaefffbb8b
@ -18,6 +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';
|
||||||
|
|
||||||
interface FileRowProps {
|
interface FileRowProps {
|
||||||
id: string;
|
id: string;
|
||||||
@ -83,14 +84,12 @@ export function FileRow({ id, file }: FileRowProps) {
|
|||||||
>
|
>
|
||||||
<GridItem area="cover">
|
<GridItem area="cover">
|
||||||
<Center w="160px" h="160px" m="auto">
|
<Center w="160px" h="160px" m="auto">
|
||||||
{metadata && (
|
<Image
|
||||||
<Image
|
objectFit="cover"
|
||||||
objectFit="cover"
|
src={metadata?.cover}
|
||||||
src={metadata.cover}
|
alt={`${metadata?.album} 的专辑封面`}
|
||||||
alt={`"${metadata.album}" 的专辑封面`}
|
fallbackSrc={coverSvgUrl}
|
||||||
fallbackSrc={'/assets/no-cover.svg'}
|
/>
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Center>
|
</Center>
|
||||||
</GridItem>
|
</GridItem>
|
||||||
<GridItem area="title">
|
<GridItem area="title">
|
||||||
|
Loading…
Reference in New Issue
Block a user