BranchingPlanNotice.tsx32 lines · main
| 1 | import { AlertCircleIcon } from 'lucide-react' |
| 2 | import Link from 'next/link' |
| 3 | import { Alert, AlertDescription, AlertTitle, Button } from 'ui' |
| 4 | |
| 5 | import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization' |
| 6 | import { useAppStateSnapshot } from '@/state/app-state' |
| 7 | |
| 8 | export const BranchingPlanNotice = () => { |
| 9 | const snap = useAppStateSnapshot() |
| 10 | const { data: selectedOrg } = useSelectedOrganizationQuery() |
| 11 | |
| 12 | return ( |
| 13 | <Alert className="rounded-none px-7 py-6 [&>svg]:top-6 [&>svg]:left-6 border-0 border-t"> |
| 14 | <AlertCircleIcon /> |
| 15 | <AlertTitle>Database branching is only available on the Pro Plan and above</AlertTitle> |
| 16 | <AlertDescription> |
| 17 | Go to your organization's billing settings and upgrade your plan to enable branching for |
| 18 | this project |
| 19 | </AlertDescription> |
| 20 | <AlertDescription> |
| 21 | <Button size="tiny" type="default" className="mt-4"> |
| 22 | <Link |
| 23 | href={`/org/${selectedOrg?.slug}/billing?panel=subscriptionPlan&source=enableBranchingButton`} |
| 24 | onClick={() => snap.setShowCreateBranchModal(false)} |
| 25 | > |
| 26 | Upgrade to Pro |
| 27 | </Link> |
| 28 | </Button> |
| 29 | </AlertDescription> |
| 30 | </Alert> |
| 31 | ) |
| 32 | } |