SubmitButton.tsx39 lines · main
| 1 | import type { MouseEventHandler } from 'react' |
| 2 | // End of third-party imports |
| 3 | |
| 4 | import { Button, cn } from 'ui' |
| 5 | |
| 6 | interface SubmitButtonProps { |
| 7 | isSubmitting: boolean |
| 8 | userEmail: string |
| 9 | onClick?: MouseEventHandler<HTMLButtonElement> |
| 10 | className?: string |
| 11 | descriptionClassName?: string |
| 12 | } |
| 13 | |
| 14 | export function SubmitButton({ |
| 15 | isSubmitting, |
| 16 | userEmail, |
| 17 | onClick, |
| 18 | className, |
| 19 | descriptionClassName, |
| 20 | }: SubmitButtonProps) { |
| 21 | return ( |
| 22 | <div className={cn('flex flex-col gap-3', className)}> |
| 23 | <Button |
| 24 | htmlType="submit" |
| 25 | size="small" |
| 26 | block |
| 27 | disabled={isSubmitting} |
| 28 | loading={isSubmitting} |
| 29 | onClick={onClick} |
| 30 | > |
| 31 | Send support request |
| 32 | </Button> |
| 33 | <p className={cn('text-xs text-foreground-lighter text-balance pr-4', descriptionClassName)}> |
| 34 | We will contact you at <span className="text-foreground font-medium">{userEmail}</span>. |
| 35 | Please ensure emails from supabase.com are allowed. |
| 36 | </p> |
| 37 | </div> |
| 38 | ) |
| 39 | } |