1import React from 'react'; 2import {StyleSheet, View} from 'react-native'; 3import rpx from '@/utils/rpx'; 4import {ROUTE_PATH, useNavigate} from '@/entry/router'; 5import ImageBtn from '../base/imageBtn'; 6 7interface ISheetItemProps { 8 pluginHash: string; 9 sheetInfo: IMusic.IMusicSheetItemBase; 10} 11 12const marginBottom = rpx(16); 13 14export default function SheetItem(props: ISheetItemProps) { 15 const {sheetInfo, pluginHash} = props ?? {}; 16 const navigate = useNavigate(); 17 return ( 18 <View style={style.imageWrapper}> 19 <ImageBtn 20 style={{ 21 marginBottom, 22 }} 23 uri={sheetInfo?.artwork ?? sheetInfo?.coverImg} 24 title={sheetInfo?.title} 25 onPress={() => { 26 navigate(ROUTE_PATH.PLUGIN_SHEET_DETAIL, { 27 pluginHash, 28 sheetInfo, 29 }); 30 }} 31 /> 32 </View> 33 ); 34} 35const style = StyleSheet.create({ 36 imageWrapper: { 37 width: '100%', 38 justifyContent: 'center', 39 alignItems: 'center', 40 }, 41}); 42