1bf6e62f2S猫头猫import React from 'react'; 2bf6e62f2S猫头猫import {Appbar} from 'react-native-paper'; 31c06c799S猫头猫import {StyleSheet, View} from 'react-native'; 4bf6e62f2S猫头猫import rpx from '@/utils/rpx'; 503f1f70cS猫头猫import {useNavigation, useRoute} from '@react-navigation/native'; 6bf6e62f2S猫头猫import usePrimaryColor from '@/hooks/usePrimaryColor'; 703f1f70cS猫头猫import AppBarWithSearch from '@/components/base/appBarWithSearch'; 8*e14deecfS猫头猫import MusicSheet from '@/core/musicSheet'; 903f1f70cS猫头猫import {ROUTE_PATH} from '@/entry/router'; 10a3289929S猫头猫import useDialog from '@/components/dialogs/useDialog'; 11bf6e62f2S猫头猫 12bf6e62f2S猫头猫interface IProps {} 13bf6e62f2S猫头猫export default function (props: IProps) { 1403f1f70cS猫头猫 const navigation = useNavigation<any>(); 1503f1f70cS猫头猫 const route = useRoute<any>(); 1603f1f70cS猫头猫 const id = route.params?.id ?? 'favorite'; 1703f1f70cS猫头猫 const musicSheet = MusicSheet.useSheets(id); 18a3289929S猫头猫 const {showDialog} = useDialog(); 19bf6e62f2S猫头猫 20bf6e62f2S猫头猫 return ( 2103f1f70cS猫头猫 <AppBarWithSearch 2203f1f70cS猫头猫 title="歌单" 2303f1f70cS猫头猫 onSearchPress={() => { 2403f1f70cS猫头猫 navigation.navigate(ROUTE_PATH.SEARCH_MUSIC_LIST, { 25a3289929S猫头猫 musicList: musicSheet?.musicList, 2603f1f70cS猫头猫 }); 27a3289929S猫头猫 }} 28a3289929S猫头猫 menuOptions={[ 29a3289929S猫头猫 { 30a3289929S猫头猫 icon: 'trash-can-outline', 31a3289929S猫头猫 title: '删除歌单', 32a3289929S猫头猫 show: id !== 'favorite', 33a3289929S猫头猫 onPress() { 34a3289929S猫头猫 showDialog('SimpleDialog', { 35a3289929S猫头猫 title: '删除歌单', 36a3289929S猫头猫 content: `确定删除歌单${musicSheet.title}吗?`, 37a3289929S猫头猫 onOk: async () => { 38a3289929S猫头猫 await MusicSheet.removeSheet(id); 39a3289929S猫头猫 navigation.goBack(); 40a3289929S猫头猫 }, 41a3289929S猫头猫 }); 42a3289929S猫头猫 }, 43a3289929S猫头猫 }, 44a3289929S猫头猫 ]}></AppBarWithSearch> 45bf6e62f2S猫头猫 ); 46bf6e62f2S猫头猫} 47bf6e62f2S猫头猫 48bf6e62f2S猫头猫const style = StyleSheet.create({ 49bf6e62f2S猫头猫 appbar: { 50bf6e62f2S猫头猫 shadowColor: 'transparent', 51bf6e62f2S猫头猫 flexDirection: 'row', 52bf6e62f2S猫头猫 width: rpx(750), 53bf6e62f2S猫头猫 }, 54bf6e62f2S猫头猫}); 55