DestinationNameInput.tsx25 lines · main
1import type { UseFormReturn } from 'react-hook-form'
2import { FormControl, FormField, Input } from 'ui'
3import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
4
5import type { DestinationPanelSchemaType } from './DestinationForm.schema'
6
7type DestinationNameInputProps = {
8 form: UseFormReturn<DestinationPanelSchemaType>
9}
10
11export 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}