DestinationNameInput.tsx 749 B

12345678910111213141516171819202122232425
  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. import type { DestinationPanelSchemaType } from './DestinationForm.schema'
  5. type DestinationNameInputProps = {
  6. form: UseFormReturn<DestinationPanelSchemaType>
  7. }
  8. export const DestinationNameInput = ({ form }: DestinationNameInputProps) => {
  9. return (
  10. <FormField
  11. control={form.control}
  12. name="name"
  13. render={({ field }) => (
  14. <FormItemLayout label="Name" layout="horizontal">
  15. <FormControl>
  16. <Input {...field} placeholder="My destination" />
  17. </FormControl>
  18. </FormItemLayout>
  19. )}
  20. />
  21. )
  22. }