chore: add tailwindcss

This commit is contained in:
zihluwang committed 2025-07-26 01:18:51 +08:00
1 parent 7cdbc4ac85
commit 21546b278a
5 files changed
+408 -7

No files matched your search

+21
View File
@@ -9,11 +9,21 @@ enum Level {
function App() {
const [greetMsg, setGreetMsg] = useState<string>("")
const [level, setLevel] = useState<Level>(Level.min)
const [dbInfo, setDbInfo] = useState<string>("")
async function getMessage() {
setGreetMsg(await invoke("get_message", { level }))
}
async function queryDatabase() {
try {
const result = await invoke("query_database")
setDbInfo(result as string)
} catch (error) {
setDbInfo(`Error: ${error}`)
}
}
function onChange(event: React.ChangeEvent<HTMLSelectElement>) {
const value = event.target.value as Level
setLevel(value)
@@ -37,6 +47,17 @@ function App() {
</button>
</div>
<p>{greetMsg}</p>
<div className="row">
<button
type="button"
onClick={() => {
void queryDatabase()
}}>
Query Database
</button>
</div>
<p>{dbInfo}</p>
</main>
)
}
+1
View File
@@ -0,0 +1 @@
@import "tailwindcss";