mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 10:25:06 +03:00
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Allow creating HA (Multigres) projects. Only allowed on local & staging atm, gated via entitlements. Closes FE-2448 --------- Co-authored-by: Saxon Fletcher <saxonafletcher@gmail.com>
48 lines
1.5 KiB
TypeScript
48 lines
1.5 KiB
TypeScript
import Link from 'next/link'
|
|
import { UseFormReturn } from 'react-hook-form'
|
|
|
|
import Panel from 'components/ui/Panel'
|
|
import { useCheckEntitlements } from 'hooks/misc/useCheckEntitlements'
|
|
import { FormControl_Shadcn_, FormField_Shadcn_, Switch } from 'ui'
|
|
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
|
|
import { CreateProjectForm } from './ProjectCreation.schema'
|
|
|
|
interface HighAvailabilityInputProps {
|
|
form: UseFormReturn<CreateProjectForm>
|
|
}
|
|
|
|
export const HighAvailabilityInput = ({ form }: HighAvailabilityInputProps) => {
|
|
const { hasAccess } = useCheckEntitlements('instances.high_availability')
|
|
|
|
if (!hasAccess) return null
|
|
|
|
return (
|
|
<Panel.Content>
|
|
<FormField_Shadcn_
|
|
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_Shadcn_>
|
|
<Switch checked={field.value} onCheckedChange={field.onChange} />
|
|
</FormControl_Shadcn_>
|
|
</FormItemLayout>
|
|
)}
|
|
/>
|
|
</Panel.Content>
|
|
)
|
|
}
|