-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.tsx
44 lines (39 loc) · 1.1 KB
/
options.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { Container, SegmentedControl, Text, TextInput } from "@mantine/core"
import { useStorage } from "@plasmohq/storage/hook"
import storage from "~storage"
export default function Options() {
const [apiKey, setApiKey] = useStorage({
key: "kagiToken",
instance: storage
})
const [model, setModel] = useStorage("kagiSummarizerEngine", (v) =>
v === undefined ? "daphne" : v
)
return (
<Container
style={{
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
height: "100vh"
}}>
<TextInput
label="Enter your Kagi API key"
placeholder="e.g. xxxxxxxx.xxxxxxxxxxxx"
value={apiKey}
onChange={(event) => setApiKey(event.currentTarget.value)}
style={{ marginBottom: "1rem", minWidth: "300px" }}
/>
<Text>Select Model</Text>
<SegmentedControl
data={[
{ label: "Casual", value: "daphne" },
{ label: "Technical", value: "agnes" }
]}
value={model}
onChange={setModel}
/>
</Container>
)
}