Repository: supabase/supabase
File: apps/studio/components/interfaces/Database/Triggers/TriggerSheet.tsx (TypeScript)

Code before:
      if (isDuplicatingTrigger && selectedTrigger) {
        const initalSelectedTable = tables.find((t) => t.name === selectedTrigger.table)

        form.reset({
          ...selectedTrigger,
          tableId: initalSelectedTable?.id.toString(),
          table: initalSelectedTable?.name,
          schema: initalSelectedTable?.schema,
        })
      } else if (isEditing) {
        form.reset(selectedTrigger)
      } else if (tables.length > 0) {
        form.reset({
          ...defaultValues,
          tableId: tables[0].id.toString(),
          table: tables[0].name,
          schema: tables[0].schema,
        })
      }
    }
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, [open, isSuccess])

  return (
    <>
      <Sheet open={open} onOpenChange={() => isClosingSidePanel()}>
        <SheetContent size="lg" className="flex flex-col gap-0">
          <SheetHeader>
            <SheetTitle>
              {isDuplicatingTrigger
                ? 'Duplicate trigger'
                : isEditing
                  ? `Edit database trigger: ${selectedTrigger.name}`
                  : 'Create a new database trigger'}
            </SheetTitle>
          </SheetHeader>

          <Form_Shadcn_ {...form}>
            <form
              id={formId}
              className="flex-1 flex flex-col gap-y-6 overflow-auto py-6"
              onSubmit={form.handleSubmit(onSubmit)}
            >
              <FormField_Shadcn_
                name="name"
                control={form.control}
                render={({ field }) => (
                  <FormItemLayout
                    className="px-5"
                    layout="horizontal"
                    label="Name of trigger"

Review comment (suggestion):
```suggestion
      <Sheet open={open} onOpenChange={isClosingSidePanel}>
```

tiniest of nits 😅 

Code after:
      if (isDuplicatingTrigger && selectedTrigger) {
        const initalSelectedTable = tables.find((t) => t.name === selectedTrigger.table)

        form.reset({
          ...selectedTrigger,
          tableId: initalSelectedTable?.id.toString(),
          table: initalSelectedTable?.name,
          schema: initalSelectedTable?.schema,
        })
      } else if (isEditing) {
        form.reset(selectedTrigger)
      } else if (tables.length > 0) {
        form.reset({
          ...defaultValues,
          tableId: tables[0].id.toString(),
          table: tables[0].name,
          schema: tables[0].schema,
        })
      }
    }
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, [open, isSuccess])

  return (
    <>
      <Sheet open={open} onOpenChange={isClosingSidePanel}>
        <SheetContent size="lg" className="flex flex-col gap-0">
          <SheetHeader>
            <SheetTitle>
              {isDuplicatingTrigger
                ? 'Duplicate trigger'
                : isEditing
                  ? `Edit database trigger: ${selectedTrigger.name}`
                  : 'Create a new database trigger'}
            </SheetTitle>
          </SheetHeader>

          <Form_Shadcn_ {...form}>
            <form
              id={formId}
              className="flex-1 flex flex-col gap-y-6 overflow-auto py-6"
              onSubmit={form.handleSubmit(onSubmit)}
            >
              <FormField_Shadcn_
                name="name"
                control={form.control}
                render={({ field }) => (
                  <FormItemLayout
                    className="px-5"
                    layout="horizontal"
                    label="Name of trigger"