DestinationNameInput.tsx25 lines · main
| 1 | import type { UseFormReturn } from 'react-hook-form' |
| 2 | import { FormControl, FormField, Input } from 'ui' |
| 3 | import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout' |
| 4 | |
| 5 | import type { DestinationPanelSchemaType } from './DestinationForm.schema' |
| 6 | |
| 7 | type DestinationNameInputProps = { |
| 8 | form: UseFormReturn<DestinationPanelSchemaType> |
| 9 | } |
| 10 | |
| 11 | export const DestinationNameInput = ({ form }: DestinationNameInputProps) => { |
| 12 | return ( |
| 13 | <FormField |
| 14 | control={form.control} |
| 15 | name="name" |
| 16 | render={({ field }) => ( |
| 17 | <FormItemLayout label="Name" layout="horizontal"> |
| 18 | <FormControl> |
| 19 | <Input {...field} placeholder="My destination" /> |
| 20 | </FormControl> |
| 21 | </FormItemLayout> |
| 22 | )} |
| 23 | /> |
| 24 | ) |
| 25 | } |