Files
supabase/apps/studio/components/interfaces/Organization/restriction.constants.tsx
Gildas Garcia b30db91d71 chore: cleanup UI patterns exports (#47406)
## Problem

We now export components under a subpath in ui-patterns to avoid barrel
files as they slow down every tools (from IDE to linters, etc.) and may
also affect bundles our users have to download.

## Solution

- Remove the UI patterns index file
- Fix invalid impors
2026-06-30 09:23:17 +02:00

61 lines
2.1 KiB
TypeScript

import dayjs from 'dayjs'
import { type ReactNode } from 'react'
import { TimestampInfo } from 'ui-patterns/TimestampInfo'
import { InlineLink } from '@/components/ui/InlineLink'
export const RESTRICTION_MESSAGES = {
GRACE_PERIOD: {
title: 'Organization exceeded its quota in the previous billing cycle',
description: (date: string, slug: string): ReactNode => {
const label = dayjs(date).format('DD MMM, YYYY')
return (
<>
You have a grace period until{' '}
<TimestampInfo className="text-sm" utcTimestamp={date} label={label} />. After that, your
projects will be restricted while your organization is over quota.{' '}
<InlineLink href={`/org/${slug}/usage`}>Review usage</InlineLink> or{' '}
<InlineLink href={`/org/${slug}/billing`}>manage your plan</InlineLink> to avoid
restrictions.
</>
)
},
},
GRACE_PERIOD_OVER: {
title: 'Grace period is over',
description: (slug: string): ReactNode => (
<>
Your projects will not be able to serve requests when you use up your quota.{' '}
<InlineLink href={`/org/${slug}/billing`}>Review billing</InlineLink>
</>
),
},
RESTRICTED: {
title: 'Services restricted',
description: (slug: string): ReactNode => (
<>
Your projects are unable to serve requests as your organization has used up its quota.{' '}
<InlineLink href={`/org/${slug}/billing`}>Resolve billing issues</InlineLink>
</>
),
},
OVERDUE_INVOICES: {
title: 'Outstanding invoices',
description: (slug: string): ReactNode => (
<>
Please <InlineLink href={`/org/${slug}/billing#invoices`}>pay your invoices</InlineLink> to
avoid service disruption
</>
),
},
OVERDUE_INVOICES_FROM_OTHER_ORGS: {
title: 'Outstanding invoices in other organization',
description: (slug: string): ReactNode => (
<>
Please <InlineLink href={`/org/${slug}/billing#invoices`}>pay invoices</InlineLink> for
other organizations to avoid service disruption
</>
),
},
}