Files
supabase/apps/studio/components/interfaces/Support/SubmitButton.tsx
Saxon Fletcher 4452e0ac2e Support form sidebar (#45203)
Refactors our help sidebar within Studio to include the actual support
form itself when contact is selected. This PR also cleans up the initial
state of the sidebar and the options within.

## To test:
- Open an org and click the help icon top right
- Click contact support
- Submit a support ticket
- Click done to return to support sidebar state

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Support form V3 and support sidebar with status button; direct-email
helper and URL prefill
* Success screen supports onFinish callback and customizable finish
label
* AI Assistant and Help options accept optional click callbacks;
resource items gain keyboard/accessibility support

* **Refactor**
  * Help panel split into home/support views with back navigation
* Support components accept flexible align/className props and
layout/styling tweaks
  * Initial URL params loader added for support form

* **Tests**
* New/updated tests for support flows, success screen, and help options
interactions
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com>
2026-05-08 13:51:49 +10:00

40 lines
994 B
TypeScript

import type { MouseEventHandler } from 'react'
// End of third-party imports
import { Button, cn } from 'ui'
interface SubmitButtonProps {
isSubmitting: boolean
userEmail: string
onClick?: MouseEventHandler<HTMLButtonElement>
className?: string
descriptionClassName?: string
}
export function SubmitButton({
isSubmitting,
userEmail,
onClick,
className,
descriptionClassName,
}: SubmitButtonProps) {
return (
<div className={cn('flex flex-col gap-3', className)}>
<Button
htmlType="submit"
size="small"
block
disabled={isSubmitting}
loading={isSubmitting}
onClick={onClick}
>
Send support request
</Button>
<p className={cn('text-xs text-foreground-lighter text-balance pr-4', descriptionClassName)}>
We will contact you at <span className="text-foreground font-medium">{userEmail}</span>.
Please ensure emails from supabase.com are allowed.
</p>
</div>
)
}