BranchingPlanNotice.tsx 1.2 KB

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