import { cn, Dialog, DialogContent, DialogFooter, DialogHeader, DialogSection, DialogSectionSeparator, DialogTitle, DialogTrigger, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from 'ui' import { useGetReplicaCost } from './useGetReplicaCost' import { TaxDisclaimer } from '@/components/interfaces/Billing/TaxDisclaimer' import { DocsButton } from '@/components/ui/DocsButton' import { InlineLinkClassName } from '@/components/ui/InlineLink' import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject' import { DOCS_URL } from '@/lib/constants' export const ReadReplicaPricingDialog = () => { const { data: project } = useSelectedProjectQuery() const { compute, disk, iops, throughput } = useGetReplicaCost() const showNewDiskManagementUI = project?.cloud_provider === 'AWS' return ( Calculating costs for a new read replica {showNewDiskManagementUI ? ( <>

Read replicas will match the compute size of your primary database and will include 25% more disk size than the primary database to accommodate WAL files.

The additional cost for the replica breaks down to:

Item Description Cost (/month) Compute size {compute.label} {compute.cost} Disk size {disk.label} {disk.cost} IOPS {iops.label} {iops.cost} {disk.type === 'gp3' && ( Throughput {throughput.label} {throughput.cost} )}
) : (

Read replicas will be on the same compute size as your primary database. Deploying a read replica on the {compute.label} size incurs additional{' '} {compute?.priceDescription} .

)}
) }