diff --git a/field-logic/src/components/SurveyWizard.tsx b/field-logic/src/components/SurveyWizard.tsx index 4f7bc72..d4e03ac 100644 --- a/field-logic/src/components/SurveyWizard.tsx +++ b/field-logic/src/components/SurveyWizard.tsx @@ -1,6 +1,6 @@ import React, { useState, useEffect } from 'react'; -import { SurveyEngine } from '../lib/engine'; -import type { SurveyDefinition, SurveyNode } from '../lib/types'; +import { SurveyEngine } from '../lib/SurveyEngine'; +import type { SurveyDefinition, SurveyNode } from '../types/schema'; import '../styles/main.css'; interface Props { @@ -30,7 +30,7 @@ export const SurveyWizard: React.FC = ({ definition }) => { return; } - const nextNode = engine.next(inputValue); + const nextNode = engine.submitAnswer(inputValue); setCurrentNode(nextNode); setInputValue(null); // Reset input for next question }; @@ -39,7 +39,7 @@ export const SurveyWizard: React.FC = ({ definition }) => { setInputValue(e.target.value); }; - const handleChoiceSelect = (value: any) => { + const handleChoiceSelect = (value: string | boolean) => { setInputValue(value); }; diff --git a/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json b/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json new file mode 100644 index 0000000..27c2823 --- /dev/null +++ b/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json @@ -0,0 +1 @@ +{"version":"4.0.18","results":[[":field-logic/src/lib/engine.test.ts",{"duration":7.450498999999979,"failed":false}]]} \ No newline at end of file