返回 AiToEarn
page.tsx
1 /*
2 * @Author: nevin
3 * @Date: 2025-02-10 22:20:15
4 * @LastEditTime: 2025-02-22 00:10:04
5 * @LastEditors: nevin
6 * @Description:
7 */
8 import styles from './publish.module.scss';
9 import {
10 VideoCameraOutlined,
11 FileImageOutlined,
12 ContainerOutlined,
13 } from '@ant-design/icons';
14 import { Segmented } from 'antd';
15 import { Outlet, useLocation, useNavigate } from 'react-router-dom';
16 import { useEffect, useState } from 'react';
17
18 export default function Page() {
19 const navigate = useNavigate();
20 const location = useLocation();
21 const [currChooseRoute, setCurrChooseRoute] = useState<string>();
22
23 useEffect(() => {
24 setCurrChooseRoute(location.pathname);
25 }, [location]);
26
27 return (
28 <div className={styles.publish}>
29 <Segmented
30 value={currChooseRoute}
31 vertical
32 size="large"
33 options={[
34 {
35 label: '视频发布',
36 value: '/publish/video',
37 icon: <VideoCameraOutlined />,
38 },
39 // { label: '文章发布', value: '/publish/text', icon: <FileOutlined /> },
40 {
41 label: '图片发布',
42 value: '/publish/image',
43 icon: <FileImageOutlined />,
44 },
45 {
46 label: '发布记录',
47 value: '/publish/pubRecord',
48 icon: <ContainerOutlined />,
49 },
50 ]}
51 onChange={(value) => {
52 navigate(value);
53 }}
54 />
55 <Outlet />
56 </div>
57 );
58 }
59
59 lines Plain Text