import "./index.less"; import Player from "../../components/Player"; import { useMount } from "../../hook"; import { Select, Message, Space, Tooltip } from "@arco-design/web-react"; const Option = Select.Option; const options = ["全部", "最新的"]; import BsCard from "../../components/Card"; import TimeScroll from "../../components/TimeScroll"; import Tab20Regular from "@ricons/fluent/Tab20Regular"; import Table20Regular from "@ricons/fluent/Table20Regular"; import { useState } from "react"; import { recommendListDefault, courseTimeListDefault } from "./mock"; export default function Index() { useMount(() => {}); const [actions, setActions] = useState([ { key: "tab", icon: Tab20Regular, active: false, tip: "单格排列", }, { key: "table", icon: Table20Regular, active: true, tip: "缩略", }, ]); const [recommendList, setRecommendList] = useState(recommendListDefault); const [courseTimeList, setCourseTimeList] = useState(courseTimeListDefault); const onClickActionItem = (action: any) => { setActions((p) => p.map((a) => ({ ...a, active: a.key === action.key }))); }; return (
{recommendList.map((item, index) => ( ))}
{actions.map((action) => ( onClickActionItem(action)} > ))}
{courseTimeList.map((item, index) => (
{item.year}年{item.month}月
{item.data.length} 个视频
{item.data.map((d: any) => ( ))}
))}
); }