xref: /MusicFree/src/components/mediaItem/topListItem.tsx (revision 5589cdf32b2bb0f641e5ac7bf1f6152cd6b9b70e)
1d52aa40eS猫头猫import React from 'react';
2d52aa40eS猫头猫// import {ROUTE_PATH, useNavigate} from '@/entry/router';
31119c2eaS猫头猫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;
9ceb900cdS猫头猫    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
18*5589cdf3S猫头猫            withHorizontalPadding
19d52aa40eS猫头猫            onPress={() => {
20cee6bc49S猫头猫                navigate(ROUTE_PATH.TOP_LIST_DETAIL, {
21cee6bc49S猫头猫                    pluginHash: pluginHash,
22cee6bc49S猫头猫                    topList: topListItem,
23cee6bc49S猫头猫                });
241119c2eaS猫头猫            }}>
251119c2eaS猫头猫            <ListItem.ListItemImage
261119c2eaS猫头猫                uri={topListItem?.coverImg}
271119c2eaS猫头猫                fallbackImg={ImgAsset.albumDefault}
28d52aa40eS猫头猫            />
291119c2eaS猫头猫            <ListItem.Content
301119c2eaS猫头猫                title={topListItem.title}
311119c2eaS猫头猫                description={`${topListItem.description ?? ''}`}
321119c2eaS猫头猫            />
331119c2eaS猫头猫        </ListItem>
34d52aa40eS猫头猫    );
35d52aa40eS猫头猫}
36