SupportFormDirectEmailInfo.tsx 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import { toast } from 'sonner'
  2. import { NO_PROJECT_MARKER } from './SupportForm.utils'
  3. import CopyButton from '@/components/ui/CopyButton'
  4. interface SupportFormDirectEmailContentProps {
  5. projectRef: string | null
  6. }
  7. export function SupportFormDirectEmailContent({ projectRef }: SupportFormDirectEmailContentProps) {
  8. const hasProjectRef = projectRef && projectRef !== NO_PROJECT_MARKER
  9. return (
  10. <div className="text-sm text-foreground-light">
  11. <p className="flex items-center gap-x-1.5 flex-wrap">
  12. Please email us directly at
  13. <span className="inline-flex items-center gap-x-1">
  14. <a
  15. href={`mailto:support@supabase.com?subject=${encodeURIComponent('Support Request')}${hasProjectRef ? `${encodeURIComponent(' for Project ID: ')}${encodeURIComponent(projectRef)}` : ''}&body=${encodeURIComponent('Here is a detailed description of the problem I am experiencing and any other information that might be helpful...')}`}
  16. className="hover:text-foreground transition-colors duration-100"
  17. >
  18. <code className="text-code-inline !text-foreground-light underline decoration-foreground-lighter/50 hover:decoration-foreground-lighter/80 transition-colors duration-100">
  19. support@supabase.com
  20. </code>
  21. </a>
  22. <CopyButton
  23. type="text"
  24. text="support@supabase.com"
  25. iconOnly
  26. onClick={() => toast.success('Copied email address to clipboard')}
  27. />
  28. </span>{' '}
  29. and include as much information as possible
  30. {hasProjectRef && (
  31. <>
  32. , along with project ID
  33. <span className="inline-flex items-center gap-x-1">
  34. <code className="text-code-inline !text-foreground-light">{projectRef}</code>
  35. <CopyButton
  36. iconOnly
  37. type="text"
  38. text={projectRef}
  39. onClick={() => toast.success('Copied project ID to clipboard')}
  40. />
  41. </span>
  42. </>
  43. )}
  44. .
  45. </p>
  46. </div>
  47. )
  48. }