TerminalInstructionsDialog.tsx25 lines · main
| 1 | import { parseAsString, useQueryState } from 'nuqs' |
| 2 | import { Dialog, DialogContent, DialogSection, DialogTitle } from 'ui' |
| 3 | |
| 4 | import { TerminalInstructions } from './TerminalInstructions' |
| 5 | |
| 6 | export const TerminalInstructionsDialog = () => { |
| 7 | const [createMethod, setCreateMethod] = useQueryState('create', parseAsString) |
| 8 | |
| 9 | const isOpen = createMethod === 'cli' |
| 10 | |
| 11 | const handleClose = () => { |
| 12 | setCreateMethod(null) |
| 13 | } |
| 14 | |
| 15 | return ( |
| 16 | <Dialog open={isOpen} onOpenChange={(open) => !open && handleClose()}> |
| 17 | <DialogContent size="large"> |
| 18 | <DialogTitle className="sr-only">Create your first Edge Function via the CLI</DialogTitle> |
| 19 | <DialogSection padding="small"> |
| 20 | <TerminalInstructions closable={false} /> |
| 21 | </DialogSection> |
| 22 | </DialogContent> |
| 23 | </Dialog> |
| 24 | ) |
| 25 | } |