mirror of
https://github.com/supabase/supabase.git
synced 2026-06-21 23:12:45 +08:00
* Break down new project page into smaller components * Fix types * Address comments * Add min length check for project name in project settings * Fix tests
29 lines
884 B
TypeScript
29 lines
884 B
TypeScript
import { UseFormReturn } from 'react-hook-form'
|
|
|
|
import Panel from 'components/ui/Panel'
|
|
import { FormControl_Shadcn_, FormField_Shadcn_, Input_Shadcn_ } from 'ui'
|
|
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
|
|
import { CreateProjectForm } from './ProjectCreation.schema'
|
|
|
|
interface ProjectNameInputProps {
|
|
form: UseFormReturn<CreateProjectForm>
|
|
}
|
|
|
|
export const ProjectNameInput = ({ form }: ProjectNameInputProps) => {
|
|
return (
|
|
<Panel.Content>
|
|
<FormField_Shadcn_
|
|
control={form.control}
|
|
name="projectName"
|
|
render={({ field }) => (
|
|
<FormItemLayout label="Project name" layout="horizontal">
|
|
<FormControl_Shadcn_>
|
|
<Input_Shadcn_ {...field} placeholder="Project name" />
|
|
</FormControl_Shadcn_>
|
|
</FormItemLayout>
|
|
)}
|
|
/>
|
|
</Panel.Content>
|
|
)
|
|
}
|