|
1
|
import { Button, FocusModal, Heading, Input, Label, Text } from "@medusajs/ui" |
|
2
|
import { useState } from "react" |
|
3
|
|
|
4
|
export default function FocusModalControlled() { |
|
5
|
const [open, setOpen] = useState(false) |
|
6
|
|
|
7
|
return ( |
|
8
|
<div> |
|
9
|
<Button onClick={() => setOpen(true)}>Edit Variant</Button> |
|
10
|
<FocusModal open={open} onOpenChange={setOpen}> |
|
11
|
<FocusModal.Content> |
|
12
|
<FocusModal.Header> |
|
13
|
<FocusModal.Title>Edit Variant</FocusModal.Title> |
|
14
|
</FocusModal.Header> |
|
15
|
<FocusModal.Body className="flex flex-col items-center py-16"> |
|
16
|
<div className="flex w-full max-w-lg flex-col gap-y-8"> |
|
17
|
<div className="flex flex-col gap-y-1"> |
|
18
|
<Heading>Create API key</Heading> |
|
19
|
<Text className="text-ui-fg-subtle"> |
|
20
|
Create and manage API keys. You can create multiple keys to |
|
21
|
organize your applications. |
|
22
|
</Text> |
|
23
|
</div> |
|
24
|
<div className="flex flex-col gap-y-2"> |
|
25
|
<Label htmlFor="key_name" className="text-ui-fg-subtle"> |
|
26
|
Key name |
|
27
|
</Label> |
|
28
|
<Input id="key_name" placeholder="my_app" /> |
|
29
|
</div> |
|
30
|
</div> |
|
31
|
</FocusModal.Body> |
|
32
|
<FocusModal.Footer> |
|
33
|
<Button onClick={() => setOpen(false)}>Save</Button> |
|
34
|
</FocusModal.Footer> |
|
35
|
</FocusModal.Content> |
|
36
|
</FocusModal> |
|
37
|
</div> |
|
38
|
) |
|
39
|
} |