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

Code before:
                                  </p>
                                </div>
                                <Button
                                  type="default"
                                  onClick={() => setShowFunctionSelector(true)}
                                >
                                  Change function
                                </Button>
                              </div>
                            )}
                          </div>
                        </FormControl_Shadcn_>
                      </FormItemLayout>
                    )}
                  />
                </>
              )}
            </form>
          </Form_Shadcn_>

          <SheetFooter className="shrink-0">
            <Button
              type="default"
              htmlType="reset"
              disabled={isCreating || isUpdating}
              onClick={() => onClose()}
            >
              Cancel
            </Button>
            <Button form={formId} htmlType="submit" loading={isCreating || isUpdating}>
              {isEditing ? 'Save' : 'Create'} trigger
            </Button>
          </SheetFooter>

          <ConfirmationModal
            visible={isClosingPanel}
            title="Discard changes"
            confirmLabel="Discard"
            onCancel={() => setIsClosingPanel(false)}
            onConfirm={() => {
              setIsClosingPanel(false)
              onClose()
            }}
          >
            <p className="text-sm text-foreground-light">
              There are unsaved changes. Are you sure you want to close the panel? Your changes will
              be lost.
            </p>
          </ConfirmationModal>
        </SheetContent>
      </Sheet>

Review comment (suggestion):
```suggestion
              onClick={onClose}
```

again 😅 

Code after:
                                  </p>
                                </div>
                                <Button
                                  type="default"
                                  onClick={() => setShowFunctionSelector(true)}
                                >
                                  Change function
                                </Button>
                              </div>
                            )}
                          </div>
                        </FormControl_Shadcn_>
                      </FormItemLayout>
                    )}
                  />
                </>
              )}
            </form>
          </Form_Shadcn_>

          <SheetFooter className="shrink-0">
            <Button
              type="default"
              htmlType="reset"
              disabled={isCreating || isUpdating}
              onClick={onClose}
            >
              Cancel
            </Button>
            <Button form={formId} htmlType="submit" loading={isCreating || isUpdating}>
              {isEditing ? 'Save' : 'Create'} trigger
            </Button>
          </SheetFooter>

          <ConfirmationModal
            visible={isClosingPanel}
            title="Discard changes"
            confirmLabel="Discard"
            onCancel={() => setIsClosingPanel(false)}
            onConfirm={() => {
              setIsClosingPanel(false)
              onClose()
            }}
          >
            <p className="text-sm text-foreground-light">
              There are unsaved changes. Are you sure you want to close the panel? Your changes will
              be lost.
            </p>
          </ConfirmationModal>
        </SheetContent>
      </Sheet>