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