Extract CheckBox, DateFieldPicker and YesNo wrappers

This commit is contained in:
2026-04-08 08:33:06 +01:00
parent 8350e42d02
commit dbebd03cac
5 changed files with 225 additions and 186 deletions
@@ -0,0 +1,26 @@
import React from "react";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { Field } from "redux-form";
import { RenderCheckBox } from "./renderCheckBox";
export function CheckBoxfield(props) {
const router = useRouter();
let { t } = useTranslation();
const fieldOptions =
router.locale == "cy" ? ["Ydw", "Na", "2323"] : ["Yes", "No", "23232"];
return (
<Field
name={props.name}
datafieldname={props.datafieldname}
label={props.label}
options={fieldOptions}
id={props.id}
className={props.className}
errorMsg={t("newappeal:select-an-option-label")}
component={RenderCheckBox}
/>
);
}