mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
The current add-ons page only lists a subset of available add-ons, which often causes confusion with things like Advanced MFA Auth (customers cant find where to configure it). The revised add-on page covers all potentially configured project add-ons including replicas and advanced disk. This should help the customer locate configured add-ons and at the same time discover potentially interesting add-ons. This can be enhanced further in the future with "smart" suggestions based on usage.
83 lines
2.6 KiB
TypeScript
83 lines
2.6 KiB
TypeScript
import { SupportCategories } from '@supabase/shared-types/out/constants'
|
|
import { Alert, AlertDescription, AlertTitle, Button } from 'ui'
|
|
|
|
import type { PitrAlertState } from './Addons.utils'
|
|
import { SupportLink } from '@/components/interfaces/Support/SupportLink'
|
|
import { ButtonTooltip } from '@/components/ui/ButtonTooltip'
|
|
|
|
interface PitrAlertProps {
|
|
state: PitrAlertState
|
|
projectRef?: string
|
|
disabledReason?: string
|
|
onEnablePitr: () => void
|
|
}
|
|
|
|
export const PitrAlert = ({ state, projectRef, disabledReason, onEnablePitr }: PitrAlertProps) => {
|
|
if (state === 'hipaa') {
|
|
return (
|
|
<Alert className="rounded-none border-0 border-b px-6">
|
|
<AlertTitle>PITR cannot be changed with HIPAA</AlertTitle>
|
|
<AlertDescription>
|
|
All projects should have PITR enabled by default and cannot be changed with HIPAA enabled.
|
|
</AlertDescription>
|
|
</Alert>
|
|
)
|
|
}
|
|
|
|
if (state === 'hipaa-non-compliant') {
|
|
return (
|
|
<Alert variant="warning" className="rounded-none border-0 border-b px-6">
|
|
<AlertTitle>Project is not HIPAA compliant</AlertTitle>
|
|
<AlertDescription>
|
|
Projects with HIPAA enabled must have 28 days of PITR. Enable the 28-day PITR add-on to
|
|
make this project compliant.
|
|
</AlertDescription>
|
|
<div className="mt-4">
|
|
<ButtonTooltip
|
|
onClick={onEnablePitr}
|
|
disabled={Boolean(disabledReason)}
|
|
tooltip={{ content: { side: 'bottom', text: disabledReason } }}
|
|
>
|
|
Enable 28-day PITR
|
|
</ButtonTooltip>
|
|
</div>
|
|
</Alert>
|
|
)
|
|
}
|
|
|
|
if (state === 'legacy-project') {
|
|
return (
|
|
<Alert className="rounded-none border-0 border-b px-6">
|
|
<AlertTitle>Your project is too old to enable PITR</AlertTitle>
|
|
<AlertDescription>
|
|
<p className="text-sm leading-normal mb-2">
|
|
Reach out to us via support if you're interested
|
|
</p>
|
|
<Button asChild>
|
|
<SupportLink
|
|
queryParams={{
|
|
projectRef,
|
|
category: SupportCategories.SALES_ENQUIRY,
|
|
subject: 'Project too old for PITR',
|
|
}}
|
|
>
|
|
Contact support
|
|
</SupportLink>
|
|
</Button>
|
|
</AlertDescription>
|
|
</Alert>
|
|
)
|
|
}
|
|
|
|
if (state === 'orioledb') {
|
|
return (
|
|
<Alert className="rounded-none border-0 border-b px-6">
|
|
<AlertTitle>PITR not supported</AlertTitle>
|
|
<AlertDescription>Point in time recovery is not supported with OrioleDB</AlertDescription>
|
|
</Alert>
|
|
)
|
|
}
|
|
|
|
return null
|
|
}
|