diff --git a/packages/frontend/src/pages/AiBuilder/components/AIFormModalContent.tsx b/packages/frontend/src/pages/AiBuilder/components/AIFormModalContent.tsx index 0d02e8bf01..bb0ef6bb74 100644 --- a/packages/frontend/src/pages/AiBuilder/components/AIFormModalContent.tsx +++ b/packages/frontend/src/pages/AiBuilder/components/AIFormModalContent.tsx @@ -6,6 +6,7 @@ import { FormControl, FormErrorMessage, ModalBody, + ModalCloseButton, ModalFooter, ModalHeader, Text, @@ -17,7 +18,14 @@ import { FormLabel, useIsMobile } from '@opengovsg/design-system-react' import pairLogo from '@/assets/pair-logo.svg' import { ImageBox } from '@/components/FlowStepConfigurationModal/ChooseAndAddConnection/ConfigureExcelConnection' import { AI_FORM_SCHEMA, AiFormData } from '@/pages/AiBuilder/schema' -import { AI_FORM_FIELDS, AI_FORM_IDEAS } from '@/pages/Flows/constants' +import { + AI_FORM_FIELDS, + AI_FORM_IDEAS, + AiChatIdea, + AiFormIdea, +} from '@/pages/Flows/constants' + +import IdeaButtons from './IdeaButtons' export const AIFormModalContent = ({ flowName, @@ -50,17 +58,20 @@ export const AIFormModalContent = ({ }, }) - const handleIdeaClick = (idea: (typeof AI_FORM_IDEAS)[number]) => { - setValue('trigger', idea.trigger, { shouldValidate: true }) - setValue('actions', idea.actions, { shouldValidate: true }) + const handleIdeaClick = (idea: AiChatIdea | AiFormIdea) => { + setValue('trigger', (idea as AiFormIdea).trigger, { shouldValidate: true }) + setValue('actions', (idea as AiFormIdea).actions, { shouldValidate: true }) } + const isCreate = type === 'create' + return ( <>