import { useEffect, useState } from "react"; import MainShell from "./components/MainShell"; import SecondaryWindow from "./windows/SecondaryWindow"; function App() { const [theme, setTheme] = useState(() => localStorage.getItem("theme") || "light"); const [activeTab, setActiveTab] = useState("clone"); const [activeKnowledge, setActiveKnowledge] = useState("全部"); const [activeSkill, setActiveSkill] = useState("全部"); const [settingSection, setSettingSection] = useState("基础配置"); const [route, setRoute] = useState(() => window.location.hash.replace("#", "") || "/"); useEffect(() => { document.documentElement.dataset.theme = theme; localStorage.setItem("theme", theme); }, [theme]); useEffect(() => { const onHashChange = () => setRoute(window.location.hash.replace("#", "") || "/"); window.addEventListener("hashchange", onHashChange); return () => window.removeEventListener("hashchange", onHashChange); }, []); const isWindowRoute = route.startsWith("/window/"); return (