AuthAlert.tsx 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import { useParams } from 'common'
  2. import { ExternalLink } from 'lucide-react'
  3. import Link from 'next/link'
  4. import { Alert, AlertDescription, AlertTitle, Button, WarningIcon } from 'ui'
  5. import { DOCS_URL } from '@/lib/constants'
  6. export const AuthAlert = ({
  7. title,
  8. isHookSendSMSEnabled,
  9. }: {
  10. title: string
  11. isHookSendSMSEnabled: boolean
  12. }) => {
  13. const { ref } = useParams()
  14. switch (title) {
  15. // TODO (KM): Remove after 10th October 2024 when we disable the provider
  16. case 'Slack (Deprecated)':
  17. return (
  18. <Alert variant="warning">
  19. <WarningIcon />
  20. <AlertTitle>Slack (Deprecated) Provider</AlertTitle>
  21. <AlertDescription>
  22. Recently, Slack has updated their OAuth API. Please use the new Slack (OIDC) provider
  23. below. Developers using this provider should move over to the new provider. Please refer
  24. to our{' '}
  25. <a
  26. href={`${DOCS_URL}/guides/auth/social-login/auth-slack`}
  27. className="underline"
  28. target="_blank"
  29. >
  30. documentation
  31. </a>{' '}
  32. for more details.
  33. </AlertDescription>
  34. </Alert>
  35. )
  36. case 'Phone':
  37. return (
  38. isHookSendSMSEnabled && (
  39. <Alert>
  40. <WarningIcon />
  41. <AlertTitle>
  42. SMS provider settings are disabled while the SMS hook is enabled.
  43. </AlertTitle>
  44. <AlertDescription className="flex flex-col gap-y-3">
  45. <p>The SMS hook will be used in place of the SMS provider configured</p>
  46. <Button asChild type="default" className="w-min" icon={<ExternalLink />}>
  47. <Link href={`/project/${ref}/auth/hooks`}>View auth hooks</Link>
  48. </Button>
  49. </AlertDescription>
  50. </Alert>
  51. )
  52. )
  53. default:
  54. return null
  55. }
  56. }