mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 18:05:11 +03:00
## Context As per PR title - should not have any visual nor functional change <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Changes** - Standardized infrastructure, region, and database configuration around AWS-based environments. - Removed Fly.io-specific region and provider options from project creation, instance sizing, and infrastructure settings. - Enabled disk validation, spend-cap eligibility, backup restoration, and extension setup consistently across supported projects. - Updated billing and region displays to use the applicable AWS configuration. - **Bug Fixes** - Corrected project-specific restrictions that could incorrectly hide configuration and billing controls. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
63 lines
2.3 KiB
TypeScript
63 lines
2.3 KiB
TypeScript
import { AnimatePresence, motion } from 'framer-motion'
|
|
import Link from 'next/link'
|
|
import { AlertDescription, AlertTitle, buttonVariants, cn } from 'ui'
|
|
import { Admonition } from 'ui-patterns/Admonition'
|
|
|
|
import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization'
|
|
|
|
interface SpendCapDisabledSectionProps {
|
|
currentDiskSizeGb?: number
|
|
}
|
|
|
|
export function SpendCapDisabledSection({ currentDiskSizeGb }: SpendCapDisabledSectionProps) {
|
|
const { data: org, isPending: isOrgPending } = useSelectedOrganizationQuery()
|
|
|
|
const isSpendCapEnabled = !isOrgPending && org?.plan.id !== 'free' && !org?.usage_billing_enabled
|
|
|
|
const showAutoExpandNotice =
|
|
isSpendCapEnabled &&
|
|
currentDiskSizeGb !== undefined &&
|
|
currentDiskSizeGb > 0 &&
|
|
currentDiskSizeGb < 8
|
|
|
|
return (
|
|
<AnimatePresence>
|
|
{isSpendCapEnabled && (
|
|
<motion.div
|
|
initial={{ opacity: 0, height: 0 }}
|
|
animate={{ opacity: 1, height: 'auto' }}
|
|
exit={{ opacity: 0, height: 0 }}
|
|
transition={{ duration: 0.2 }}
|
|
className="flex flex-col gap-3"
|
|
>
|
|
{showAutoExpandNotice && (
|
|
<Admonition type="default">
|
|
<AlertTitle>Your disk will auto-expand to 8 GB</AlertTitle>
|
|
<AlertDescription>
|
|
The first time your database usage triggers a resize, your disk will automatically
|
|
expand to at least 8 GB. You don't need to disable spend cap or do anything
|
|
manually for this to happen.
|
|
</AlertDescription>
|
|
</Admonition>
|
|
)}
|
|
<Admonition type="default">
|
|
<AlertTitle>Spend cap limits disk size to 8 GB</AlertTitle>
|
|
<AlertDescription>
|
|
You can resize your disk up to 8 GB with spend cap enabled. To expand beyond 8 GB or
|
|
configure IOPS, throughput, and storage type, disable your spend cap.
|
|
</AlertDescription>
|
|
<div className="mt-3">
|
|
<Link
|
|
href={`/org/${org?.slug}/billing?panel=costControl`}
|
|
className={cn(buttonVariants({ variant: 'default', size: 'tiny' }))}
|
|
>
|
|
Disable spend cap
|
|
</Link>
|
|
</div>
|
|
</Admonition>
|
|
</motion.div>
|
|
)}
|
|
</AnimatePresence>
|
|
)
|
|
}
|