1import {produce} from 'immer'; 2import {useSetAtom} from 'jotai'; 3import React, {type PropsWithChildren} from 'react'; 4import {Button, ScrollView, StyleSheet, Text, View} from 'react-native'; 5import {themeStateAtom} from '@/store/themeState'; 6import rpx from '@/utils/rpx'; 7import ActionButton from './ActionButton'; 8import {useNavigation} from '@react-navigation/native'; 9import {ROUTE_PATH} from '@/entry/router'; 10 11export default function Operations() { 12 const navigation = useNavigation<any>(); 13 14 const actionButtons = [ 15 { 16 iconName: 'heart', 17 iconColor: 'red', 18 title: '我喜欢', 19 action() { 20 navigation.navigate(ROUTE_PATH.SHEET_DETAIL, { 21 id: 'favorite', 22 }); 23 }, 24 }, 25 { 26 iconName: 'folder-music-outline', 27 title: '本地音乐', 28 action() { 29 navigation.navigate(ROUTE_PATH.LOCAL); 30 }, 31 }, 32 // { 33 // iconName: 'ios-time-sharp', 34 // title: '最近播放', 35 // action(){ 36 // console.log('最近'); 37 // } 38 // }, 39 { 40 iconName: 'download-circle-outline', 41 title: '下载列表', 42 action() { 43 console.log('下载'); 44 }, 45 }, 46 ]; 47 48 return ( 49 <View style={style.wrapper}> 50 {actionButtons.map(action => ( 51 <ActionButton key={action.title} {...action}></ActionButton> 52 ))} 53 </View> 54 ); 55} 56 57const style = StyleSheet.create({ 58 wrapper: { 59 width: rpx(750), 60 flexDirection: 'row', 61 height: rpx(144), 62 justifyContent: 'space-between', 63 paddingHorizontal: rpx(24), 64 marginTop: rpx(24), 65 }, 66}); 67