Home / Function/ PITRNotice() — supabase Function Reference

PITRNotice() — supabase Function Reference

Architecture documentation for the PITRNotice() function in PITRNotice.tsx from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  4c57244f_863a_29eb_0856_87d90488f3dd["PITRNotice()"]
  1b036dc2_2cc7_7355_4d5f_22cb532d4361["getPITRRetentionDuration()"]
  4c57244f_863a_29eb_0856_87d90488f3dd -->|calls| 1b036dc2_2cc7_7355_4d5f_22cb532d4361
  style 4c57244f_863a_29eb_0856_87d90488f3dd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/studio/components/interfaces/Database/Backups/PITR/PITRNotice.tsx lines 12–65

export const PITRNotice = () => {
  const { ref: projectRef } = useParams()
  const { data: addonsResponse } = useProjectAddonsQuery({ projectRef })
  const retentionPeriod = getPITRRetentionDuration(addonsResponse?.selected_addons ?? [])

  const { can: canUpdateSubscription } = useAsyncCheckPermissions(
    PermissionAction.BILLING_WRITE,
    'stripe.subscriptions'
  )

  return (
    <FormPanel
      disabled={true}
      footer={
        <div className="flex items-center justify-between p-6">
          <span className="text-sm text-foreground-light">
            You can also increase your recovery retention period updating your PITR add-on
          </span>
          <ButtonTooltip
            asChild
            disabled={!canUpdateSubscription}
            type="default"
            tooltip={{
              content: {
                side: 'bottom',
                text: !canUpdateSubscription
                  ? 'You need additional permissions to amend subscriptions'
                  : undefined,
              },
            }}
          >
            <Link href={`/project/${projectRef}/settings/addons?panel=pitr`}>
              Increase retention period
            </Link>
          </ButtonTooltip>
        </div>
      }
    >
      <div className="flex p-6 space-x-6">
        <div className="flex items-center justify-center w-10 h-10 rounded bg-border-strong">
          <Calendar strokeWidth={2} />
        </div>
        <div className="space-y-2">
          <p className="text-sm">Recovery retention period</p>
          <p className="text-sm text-foreground-light">
            Database changes are logged every <span className="text-foreground">2 minutes</span>,
            with a total recovery period of up to{' '}
            <span className="text-brand">{retentionPeriod} days</span>.
          </p>
        </div>
      </div>
    </FormPanel>
  )
}

Subdomains

Frequently Asked Questions

What does PITRNotice() do?
PITRNotice() is a function in the supabase codebase.
What does PITRNotice() call?
PITRNotice() calls 1 function(s): getPITRRetentionDuration.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free