forked from Gerome-Elassaad/CodingIT
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate-code-dialog.tsx
More file actions
39 lines (37 loc) · 971 Bytes
/
Copy pathgenerate-code-dialog.tsx
File metadata and controls
39 lines (37 loc) · 971 Bytes
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
import {
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
} from '@/components/ui/dialog'
import { Input } from '@/components/ui/input'
import { Button } from '@/components/ui/button'
import { useState } from 'react'
export function GenerateCodeDialog({
open,
onClose,
onSubmit,
}: {
open: boolean
onClose: () => void
onSubmit: (prompt: string) => void
}) {
const [prompt, setPrompt] = useState('')
return (
<Dialog open={open} onOpenChange={onClose}>
<DialogContent>
<DialogHeader>
<DialogTitle>Generate Code</DialogTitle>
</DialogHeader>
<div className="grid gap-4 py-4">
<Input
placeholder="Enter your prompt..."
value={prompt}
onChange={(e) => setPrompt(e.target.value)}
/>
<Button onClick={() => onSubmit(prompt)}>Generate</Button>
</div>
</DialogContent>
</Dialog>
)
}