ProjectNameInput.tsx28 lines · main
| 1 | import { UseFormReturn } from 'react-hook-form' |
| 2 | import { FormControl, FormField, Input } from 'ui' |
| 3 | import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout' |
| 4 | |
| 5 | import { CreateProjectForm } from './ProjectCreation.schema' |
| 6 | import Panel from '@/components/ui/Panel' |
| 7 | |
| 8 | interface ProjectNameInputProps { |
| 9 | form: UseFormReturn<CreateProjectForm> |
| 10 | } |
| 11 | |
| 12 | export const ProjectNameInput = ({ form }: ProjectNameInputProps) => { |
| 13 | return ( |
| 14 | <Panel.Content> |
| 15 | <FormField |
| 16 | control={form.control} |
| 17 | name="projectName" |
| 18 | render={({ field }) => ( |
| 19 | <FormItemLayout label="Project name" layout="horizontal"> |
| 20 | <FormControl> |
| 21 | <Input {...field} placeholder="Project name" /> |
| 22 | </FormControl> |
| 23 | </FormItemLayout> |
| 24 | )} |
| 25 | /> |
| 26 | </Panel.Content> |
| 27 | ) |
| 28 | } |