import { useParams } from 'common' import { useState } from 'react' import { toast } from 'sonner' import { Button, cn, Dialog, DialogContent, DialogFooter, DialogHeader, DialogSection, DialogSectionSeparator, DialogTitle, DialogTrigger, } from 'ui' import { Admonition } from 'ui-patterns/admonition' import { DestinationType } from './DestinationPanel/DestinationPanel.types' import { DocsButton } from '@/components/ui/DocsButton' import { InlineLink } from '@/components/ui/InlineLink' import { UpgradePlanButton } from '@/components/ui/UpgradePlanButton' import { useCreateTenantSourceMutation } from '@/data/replication/create-tenant-source-mutation' import { DOCS_URL } from '@/lib/constants' const EnablePipelinesModal = () => { const { ref: projectRef } = useParams() const [open, setOpen] = useState(false) const { mutate: createTenantSource, isPending: creatingTenantSource } = useCreateTenantSourceMutation({ onSuccess: () => { toast.success('Pipelines has been successfully enabled!') setOpen(false) }, onError: (error) => { toast.error(`Failed to enable Pipelines: ${error.message}`) }, }) const onEnablePipelines = async () => { if (!projectRef) return console.error('Project ref is required') createTenantSource({ projectRef }) } return ( Enable Pipelines

Public alpha features may change as we refine the product and incorporate customer feedback.

Pipelines is billed for configured pipeline hours, initial sync data, and ongoing replication data. Review the{' '} Pipelines pricing {' '} before enabling it.

) } export const EnablePipelinesCallout = ({ type, className, hasAccess, }: { type?: DestinationType | null className?: string hasAccess: boolean }) => { return (

Enable Pipelines

Supabase Pipelines replicates database changes to supported destination systems.{' '} {hasAccess ? 'Enable Pipelines for your project' : 'Upgrade to the Pro plan'} to replicate database changes to {type ?? 'data warehouses and analytics platforms'}.

{hasAccess ? ( ) : ( )}
) }