HttpBodyFieldSection.tsx 996 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { UseFormReturn } from 'react-hook-form'
  2. import {
  3. FormControl,
  4. FormField,
  5. FormItem,
  6. FormLabel,
  7. FormMessage,
  8. SheetSection,
  9. TextArea,
  10. } from 'ui'
  11. import { CreateCronJobForm } from './CreateCronJobSheet/CreateCronJobSheet.constants'
  12. interface HttpBodyFieldSectionProps {
  13. form: UseFormReturn<CreateCronJobForm>
  14. }
  15. export const HttpBodyFieldSection = ({ form }: HttpBodyFieldSectionProps) => {
  16. return (
  17. <SheetSection>
  18. <FormField
  19. control={form.control}
  20. name="values.httpBody"
  21. render={({ field }) => (
  22. <FormItem className="gap-1 flex flex-col">
  23. <FormLabel>HTTP Request Body</FormLabel>
  24. <FormControl>
  25. <TextArea
  26. className="h-72 rounded-none px-4 outline-hidden"
  27. value={field.value}
  28. onChange={field.onChange}
  29. />
  30. </FormControl>
  31. <FormMessage />
  32. </FormItem>
  33. )}
  34. />
  35. </SheetSection>
  36. )
  37. }