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