TerminalInstructionsDialog.tsx 801 B

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