The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
import { useParams } from 'common'
import { ClockIcon } from 'lucide-react'
import Link from 'next/link'
import { Button } from 'ui'
import { ButtonTooltip } from '@/components/ui/ButtonTooltip'
import { FGA_PERMISSIONS, useAsyncCheckPermissionsV2 } from '@/hooks/misc/useCheckPermissionsV2'
import { useAppStateSnapshot } from '@/state/app-state'
export const BranchingPITRNotice = () => {
const { ref } = useParams()
const snap = useAppStateSnapshot()
const { can: canUpdateSubscription } = useAsyncCheckPermissionsV2(
FGA_PERMISSIONS.ORGANIZATION.BILLING_WRITE
)
return (
<div className="flex flex-row gap-4">
<div>
<figure className="w-10 h-10 rounded-md border flex items-center justify-center">
<ClockIcon className="text-warning-700" size={20} strokeWidth={2} />
</figure>
</div>
<div className="flex grow items-center justify-between gap-4">
<div className="flex flex-col gap-y-1">
<p className="text-sm text-foreground">Consider enabling Point in Time Recovery (PITR)</p>
<p className="text-sm text-foreground-light">
This ensures you can recover production data if you merge a bad migration (e.g. delete a
column).
</p>
</div>
{!canUpdateSubscription ? (
<ButtonTooltip
disabled
size="tiny"
tooltip={{
content: {
side: 'bottom',
text: 'You need additional permissions to amend subscriptions',
},
}}
>
Enable PITR add-on
</ButtonTooltip>
) : (
<Button size="tiny" asChild>
<Link
href={`/project/${ref}/settings/addons?panel=pitr`}
onClick={() => snap.setShowCreateBranchModal(false)}
>
Enable PITR
</Link>
</Button>
)}
</div>
</div>
)
}