import { useParams } from 'common' import { useRef } from 'react' import { UseFormReturn } from 'react-hook-form' import { type CloudProvider } from 'shared-data' import { FormControl, FormField, Input, useWatch } from 'ui' import { CollapsibleCardSection } from 'ui-patterns/CollapsibleCardSection' import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout' import { CloudProviderSelector } from './CloudProviderSelector' import { PostgresVersionSelector } from './PostgresVersionSelector' import { CreateProjectForm } from './ProjectCreation.schema' import Panel from '@/components/ui/Panel' interface InternalOnlyConfigurationProps { form: UseFormReturn } export const InternalOnlyConfiguration = ({ form }: InternalOnlyConfigurationProps) => { const { slug } = useParams() const showNonProdFields = process.env.NEXT_PUBLIC_ENVIRONMENT !== 'prod' const highAvailability = useWatch({ control: form.control, name: 'highAvailability' }) // Held here (outside the collapsible content) so the selector's last valid // selection survives the section being collapsed and reopened. const lastValidPostgresVersionSelection = useRef('') return (
( )} />
{showNonProdFields && (

The settings below are only applicable for local/staging projects

{!highAvailability && ( ( )} /> )} ( )} />
)}
) }