import useTranslation from "next-translate/useTranslation"; import Link from "next/link"; import { useRouter } from "next/router"; import { connect } from "react-redux"; import { setCurrentView } from "../../store/currentView/action"; import TopThree from "./topthree"; const WatchedCases = (props) => { let { t } = useTranslation(); const router = useRouter(); const { locale } = router; const { setCurrentView } = props; let recordCountVar = props.watchedCases.watchedCases; return (

{props.myReps ? t("myportal:submitted-reps-card-title") : t("myportal:watchedcases-card-title")}

{(props.myReps ? recordCountVar.length > 3 : recordCountVar["@odata.count"] > 3) && (
{ setCurrentView({ "viewName": "Watched Cases", "viewKey": "watchedCases", }); }} > {/* {t("myportal:viewall-link")}{" "} {props.watchedCases.watchedCases["@odata.count"] + " cases"} */} {t("myportal:viewall-link-count", { count: props.watchedCases.watchedCases[ "@odata.count" ], })}
)}
); }; const mapDispatchToProps = (dispatch) => { return { setCurrentView: (currentView) => { dispatch(setCurrentView(currentView)); }, }; }; export default connect(null, mapDispatchToProps)(WatchedCases);