BranchingPostgresVersionNotice.tsx 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { useParams } from 'common'
  2. import { AlertCircleIcon } from 'lucide-react'
  3. import Link from 'next/link'
  4. import { Alert, AlertDescription, AlertTitle, Button } from 'ui'
  5. import { useAppStateSnapshot } from '@/state/app-state'
  6. export const BranchingPostgresVersionNotice = () => {
  7. const { ref } = useParams()
  8. const snap = useAppStateSnapshot()
  9. return (
  10. <Alert className="rounded-none px-7 py-6 [&>svg]:top-6 [&>svg]:left-6 border-t-0! border-l-0! border-r-0!">
  11. <AlertCircleIcon />
  12. <AlertTitle className="text-base">
  13. Your project needs to be on Postgres 15 to enable branching
  14. </AlertTitle>
  15. <AlertDescription>
  16. Head over to your project's infrastructure settings to upgrade to the latest version of
  17. Postgres before enabling branching.
  18. </AlertDescription>
  19. <AlertDescription>
  20. <Button size="tiny" type="default" className="mt-4">
  21. <Link
  22. href={`/project/${ref}/settings/infrastructure`}
  23. onClick={() => snap.setShowCreateBranchModal(false)}
  24. >
  25. Head to project settings
  26. </Link>
  27. </Button>
  28. </AlertDescription>
  29. </Alert>
  30. )
  31. }