import { useState } from "react"; import Menu from "./menu"; import Read from "./read"; import Toy from "./bili"; import Message from "~components/ui/message"; import { clsn } from "~utils"; import "assets/global.css"; import styles from "./popup.module.less"; function IndexPopup() { const [data, setData] = useState("") const [tab, setTab] = useState(); const onBack = () => { setTab(undefined); } const onClickMenu = (value: string) => { if (value === "options") { chrome.runtime.openOptionsPage(); return; } setTab(value); } const renderBody = () => { if (tab === "read") { return ; } if (tab === "toy") { return ; } return ; } return ( <>
{renderBody()}
); } export default IndexPopup;