mirror of
https://github.com/supabase/supabase.git
synced 2026-05-08 18:00:20 -04:00
0facd341a6
## 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
48 lines
1.5 KiB
TypeScript
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>
|
|
)
|
|
}
|