new tauri packages, and a little more frontend

This commit is contained in:
polv committed 2026-02-22 08:46:52 +07:00
1 parent 14be87d4b3
commit 329d800586
3 files changed
+679 -15

No files matched your search

+16 -12
View File
@@ -2,7 +2,7 @@ import "./App.css";
import { useEffect, useState } from "react";
import { Button, Field, Input, Stack } from "@chakra-ui/react";
import { Button, Group, Input, Stack } from "@chakra-ui/react";
import { invoke } from "@tauri-apps/api/core";
import { Provider } from "./components/ui/provider";
@@ -18,28 +18,32 @@ function App() {
}, [name]);
async function greet() {
invoke("add_entry", { name });
await invoke("add_entry", { name });
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
setName("");
}
return (
<Provider>
<Stack maxW={"1000px"} margin={"0.5em auto"}>
<Field.Root
orientation={"horizontal"}
<form
onSubmit={(e) => {
e.preventDefault();
greet();
}}
>
<Input
id="greet-input"
onChange={(e) => setName(e.currentTarget.value)}
autoComplete="off"
placeholder="Enter a name..."
/>
<Button>Search</Button>
</Field.Root>
<Group attached w="full">
<Input
id="greet-input"
value={name}
onChange={(e) => setName(e.currentTarget.value)}
autoComplete="off"
placeholder="Enter a name..."
/>
<Button type="submit">Search</Button>
</Group>
</form>
<p>{greetMsg}</p>
</Stack>
</Provider>