Files
supabase/apps/studio/components/interfaces/ProjectCreation/HighAvailabilityInput.tsx
Gildas Garcia 0facd341a6 chore: remove UI form components _Shadcn_ suffix (#45212)
## Problem

We used to have a `_Shadcn_` suffix for all the shadcn form components
because we also had `formik` form components.
This is not needed anymore.

## Solution

- Remove the suffix
- Update all usages
2026-04-24 12:14:15 +02:00

48 lines
1.5 KiB
TypeScript

import Link from 'next/link'
import { UseFormReturn } from 'react-hook-form'
import { FormControl, FormField, Switch } from 'ui'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import { CreateProjectForm } from './ProjectCreation.schema'
import Panel from '@/components/ui/Panel'
import { useCheckEntitlements } from '@/hooks/misc/useCheckEntitlements'
interface HighAvailabilityInputProps {
form: UseFormReturn<CreateProjectForm>
}
export const HighAvailabilityInput = ({ form }: HighAvailabilityInputProps) => {
const { hasAccess } = useCheckEntitlements('instances.high_availability')
if (!hasAccess) return null
return (
<Panel.Content>
<FormField
control={form.control}
name="highAvailability"
render={({ field }) => (
<FormItemLayout
label="High Availability"
description={
<>
Powered by{' '}
<Link href="https://multigres.com/" target="_blank" className="text-link">
Multigres
</Link>
: horizontally scalable Postgres for multi-tenant, highly available, globally
distributed deployments while staying true to standard Postgres.
</>
}
layout="horizontal"
>
<FormControl>
<Switch checked={field.value} onCheckedChange={field.onChange} />
</FormControl>
</FormItemLayout>
)}
/>
</Panel.Content>
)
}