Files
cstb-next/src/app/prepare/page.tsx
Purp1e c2c1a4c368 [feat] global watch dir and set better check logic
todo: first time check failed should let user manually click
2025-03-21 02:42:49 +08:00

47 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use client"
import { useSteamStore } from "@/store/steam"
import { useEffect, useState } from "react"
export default function Page() {
const steam = useSteamStore()
const [steamDir, setSteamDir] = useState(steam.state.steamDir)
const [cs2Dir, setCs2Dir] = useState(steam.state.cs2Dir)
useEffect(() => {
setSteamDir(steam.state.steamDir)
setCs2Dir(steam.state.cs2Dir)
}, [steam.state.steamDir, steam.state.cs2Dir])
return (
<div
className="flex flex-col items-center justify-center w-full h-screen gap-6"
data-tauri-drag-region
>
<h1 className="text-4xl font-bold tracking-wide">CS工具箱</h1>
<p></p>
<div className="flex flex-col w-full gap-2 p-5 border rounded-lg bg-white/40">
<p>Steam所在文件夹</p>
<input
className="px-2 py-1 mb-2 rounded-lg"
value={steamDir}
onChange={(e) => {
setSteamDir(e.target.value)
steam.setDir(e.target.value)
}}
/>
<p>CS2所在文件夹</p>
<input
className="px-2 py-1 mb-2 rounded-lg"
value={cs2Dir}
onChange={(e) => {
setCs2Dir(e.target.value)
steam.setCsDir(e.target.value)
}}
/>
<p>64SteamID{steam.currentUser().steamID64}</p>
</div>
</div>
)
}