import { UseFormReturn } from 'react-hook-form' import { FormField, SheetSection } from 'ui' import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout' import { CreateCronJobForm } from './CreateCronJobSheet/CreateCronJobSheet.constants' import FunctionSelector from '@/components/ui/FunctionSelector' import SchemaSelector from '@/components/ui/SchemaSelector' interface SqlFunctionSectionProps { form: UseFormReturn } export const SqlFunctionSection = ({ form }: SqlFunctionSectionProps) => { const schema = form.watch('values.schema') return ( ( { field.onChange(name) // deselect the selected function when the schema is changed form.resetField('values.functionName') }} /> )} /> ( field.onChange(name)} /> )} /> ) }