mirror of
https://github.com/supabase/supabase.git
synced 2026-10-18 23:59:08 +03:00
* chore: cleanup packages - Avoid circular imports - Export API-types as types - pg-format without depending on Node internal Buffer (not browser-compatible) - Avoid importing from barrel files in ui dir * chore: avoid barrel file imports in studio (#27771) * chore: avoid barrel file imports - Removes some unused imports - Avoids barrel file import for faster builds + less memory * add eslint rule * type fixes * delete layouts barrel * delete components/grid barrel file * delete components/grid/utils barrel file * delete components/grid/components/common barrel file * delete components/grid/components/editor barrel file * delete components/grid/components/formatter barrel file * delete components/grid/components/grid barrel file * delete components/grid/components/header/filter barrel file * remote components/grid/store barrel file * remove components/interfaces/Auth/Policies barrel file * delete components/interfaces/Settings/Logs barrel file * delete components/ui/CodeEditor barrel file * delete components/ui/Forms barrel file * delete components/ui/Shimmers barrel file * delete data/analytics barrel file * delete hooks barrel file * cleanup lib/common/fetch barrel file * final * barral files cleanup * global react-data-grid styles * remove console.log --------- Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com> * fix build --------- Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
58 lines
1.9 KiB
TypeScript
58 lines
1.9 KiB
TypeScript
import { PermissionAction } from '@supabase/shared-types/out/constants'
|
|
import Link from 'next/link'
|
|
|
|
import { useParams } from 'common'
|
|
import { ButtonTooltip } from 'components/ui/ButtonTooltip'
|
|
import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
|
|
import { useAppStateSnapshot } from 'state/app-state'
|
|
import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button } from 'ui'
|
|
|
|
const BranchingPITRNotice = () => {
|
|
const { ref } = useParams()
|
|
const snap = useAppStateSnapshot()
|
|
|
|
const canUpdateSubscription = useCheckPermissions(
|
|
PermissionAction.BILLING_WRITE,
|
|
'stripe.subscriptions'
|
|
)
|
|
|
|
return (
|
|
<Alert_Shadcn_ className="rounded-none px-7 py-6 [&>svg]:top-6 [&>svg]:left-6 !border-t-0 !border-l-0 !border-r-0">
|
|
<AlertTitle_Shadcn_ className="text-base">
|
|
We strongly encourage enabling Point in Time Recovery (PITR)
|
|
</AlertTitle_Shadcn_>
|
|
<AlertDescription_Shadcn_>
|
|
This is to ensure that you can always recover data if you make a "bad migration". For
|
|
example, if you accidentally delete a column or some of your production data.
|
|
</AlertDescription_Shadcn_>
|
|
{!canUpdateSubscription ? (
|
|
<ButtonTooltip
|
|
disabled
|
|
size="tiny"
|
|
type="default"
|
|
className="mt-4"
|
|
tooltip={{
|
|
content: {
|
|
side: 'bottom',
|
|
text: 'You need additional permissions to amend subscriptions',
|
|
},
|
|
}}
|
|
>
|
|
Enable PITR add-on
|
|
</ButtonTooltip>
|
|
) : (
|
|
<Button size="tiny" type="default" className="mt-4">
|
|
<Link
|
|
href={`/project/${ref}/settings/addons?panel=pitr`}
|
|
onClick={() => snap.setShowEnableBranchingModal(false)}
|
|
>
|
|
Enable PITR add-on
|
|
</Link>
|
|
</Button>
|
|
)}
|
|
</Alert_Shadcn_>
|
|
)
|
|
}
|
|
|
|
export default BranchingPITRNotice
|