xref: /MusicFree/src/components/mediaItem/topListItem.tsx (revision ceb900cd812eb1b086ac040a306ddf325339e920)
1d52aa40eS猫头猫import React from 'react';
2d52aa40eS猫头猫// import {ROUTE_PATH, useNavigate} from '@/entry/router';
3d52aa40eS猫头猫import ListItem from '@/components/base/listItem';
4d52aa40eS猫头猫import {ImgAsset} from '@/constants/assetsConst';
5cee6bc49S猫头猫import {ROUTE_PATH, useNavigate} from '@/entry/router';
6d52aa40eS猫头猫
7d52aa40eS猫头猫interface ITopListResultsProps {
8cee6bc49S猫头猫    pluginHash: string;
9*ceb900cdS猫头猫    topListItem: IMusic.IMusicSheetItemBase;
10d52aa40eS猫头猫}
11d52aa40eS猫头猫
12d52aa40eS猫头猫export default function TopListItem(props: ITopListResultsProps) {
13cee6bc49S猫头猫    const {pluginHash, topListItem} = props;
14cee6bc49S猫头猫    const navigate = useNavigate();
15d52aa40eS猫头猫
16d52aa40eS猫头猫    return (
17d52aa40eS猫头猫        <ListItem
18d52aa40eS猫头猫            left={{
19d52aa40eS猫头猫                artwork: topListItem?.coverImg,
20d52aa40eS猫头猫                fallback: ImgAsset.albumDefault,
21d52aa40eS猫头猫            }}
22d52aa40eS猫头猫            title={topListItem.title}
233b3d6357S猫头猫            desc={`${topListItem.description ?? ''}`}
24d52aa40eS猫头猫            onPress={() => {
25cee6bc49S猫头猫                navigate(ROUTE_PATH.TOP_LIST_DETAIL, {
26cee6bc49S猫头猫                    pluginHash: pluginHash,
27cee6bc49S猫头猫                    topList: topListItem,
28cee6bc49S猫头猫                });
29d52aa40eS猫头猫            }}
30d52aa40eS猫头猫        />
31d52aa40eS猫头猫    );
32d52aa40eS猫头猫}
33