Files
cstb-next/src/app/(main)/preference/general/page.tsx

30 lines
777 B
TypeScript
Raw Normal View History

2024-09-27 15:28:32 +08:00
"use client"
2025-03-17 11:48:30 +08:00
import { useAppStore } from "@/store/app"
2025-03-23 23:25:28 +08:00
import { Switch } from "@heroui/react"
import { enable, isEnabled, disable } from "@tauri-apps/plugin-autostart"
2024-09-27 15:28:32 +08:00
2024-10-28 10:42:42 +08:00
export default function Page() {
2025-03-17 11:48:30 +08:00
const app = useAppStore()
2024-09-27 15:28:32 +08:00
return (
<div className="flex flex-col items-start gap-3 pt-2 pb-1">
2025-03-17 11:48:30 +08:00
<p>{app.state.version}</p>
<p>{app.state.hasUpdate ? "有" : "无"}</p>
<p>使{app.state.useMirror ? "是" : "否"}</p>
2025-03-23 23:25:28 +08:00
<Switch
// checked={() => isEnabled()}
size="sm"
onChange={(e) => {
if (e.target.checked) {
enable()
} else {
disable()
}
}}
>
</Switch>
2024-09-27 15:28:32 +08:00
</div>
)
2024-10-28 10:42:42 +08:00
}