import Link from "next/link";
import { useState } from "react";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { connect } from "react-redux";
import { Field, reduxForm } from "redux-form";
const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg;
export const minLength = (errorMsg) => (value) =>
value && value.length < 4
? errorMsg //`Must be ${min} characters or more`
: undefined;
const RenderTextfield = ({
id,
className,
rows,
datafieldname,
name,
label,
input,
hint1,
hint2,
meta: { touched, error },
...custom
}) => {
return (
<>
{hint1}
{hint2}
{" "}
CAS-00009-W8N6W4
{touched && error && (
Error:{" "}
{error}
)}
>
);
};
let CaseSearch = (props) => {
let { t } = useTranslation();
const { handleSubmit, pristine, reset, submitting } = props;
const router = useRouter();
const { locale } = router;
const onHandleSubmit = (values) => {
router.replace({
pathname: "/searchresults",
query: { q: values.basicSearch },
shallow: true,
});
};
return (
);
};
const mapStateToProps = (state) => {
return {
...state,
};
};
const mapDispatchToProps = (dispatch) => {
return {};
};
export default connect(
mapStateToProps,
mapDispatchToProps
)(
reduxForm({
form: "basicSearchForm",
destroyOnUnmount: false,
})(CaseSearch)
);