diff --git a/src/Components/HealthInsuranceError/HealthInsuranceError.tsx b/src/Components/HealthInsuranceError/HealthInsuranceError.tsx deleted file mode 100644 index f4eb2688b..000000000 --- a/src/Components/HealthInsuranceError/HealthInsuranceError.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { useEffect } from 'react'; -import { - useErrorController, - healthInsuranceDataHasError, - getHealthInsuranceError, -} from '../../Assets/validationFunctions'; -import { HealthInsurance } from '../../Types/FormData'; -import { FormHelperText } from '@mui/material'; - -interface HealthInsuranceErrorProps { - hhMemberIndex: number; - hhMemberInsurance: HealthInsurance; - submitted: number; -} - -const HealthInsuranceError = ({ hhMemberIndex, hhMemberInsurance, submitted }: HealthInsuranceErrorProps) => { - const healthInsuranceErrorController = useErrorController(healthInsuranceDataHasError, getHealthInsuranceError); - - useEffect(() => { - healthInsuranceErrorController.setSubmittedCount(submitted); - }, [submitted]); - - useEffect(() => { - healthInsuranceErrorController.updateError(hhMemberInsurance); - }); - - return ( - healthInsuranceErrorController.showError && ( - - {healthInsuranceErrorController.message({ index: hhMemberIndex, healthInsurance: hhMemberInsurance })} - - ) - ); -}; - -export default HealthInsuranceError;