import Title from "../Title"; import styles from "./styles.module.css"; import { useDispatch, useSelector } from "react-redux"; import { actions, selectors } from "@/store"; import { useTranslations } from "@/hooks/translations"; import { useNavigate } from "react-router-dom"; import routes from "@/routes"; import { EPathsFromHome } from "@/store/siteConfig"; function UserCallbacksPage(): JSX.Element { const { translate } = useTranslations(); const navigate = useNavigate(); const dispatch = useDispatch(); const statChanges = useSelector(selectors.selectUserCallbacksPrevStat); const text = useSelector(selectors.selectUserCallbacksDescription); const homeConfig = useSelector(selectors.selectHome); const showNavbarFooter = homeConfig.isShowNavbar; const handleNext = () => { if (homeConfig.pathFromHome === EPathsFromHome.compatibility) { dispatch( actions.siteConfig.update({ home: { pathFromHome: homeConfig.pathFromHome, isShowNavbar: true }, }) ); return navigate(routes.client.home()); } if (homeConfig.pathFromHome === EPathsFromHome.breath) { return navigate(routes.client.compatibility()); } if (homeConfig.pathFromHome === EPathsFromHome.navbar) { return navigate(routes.client.breath()); } }; const getPaddingBottomPage = () => { if ( homeConfig.pathFromHome === EPathsFromHome.compatibility && showNavbarFooter ) return "246px"; if (showNavbarFooter) return "164px"; return "108px"; }; return (
{
}
<> <p>Well done!</p> <p>Your results has changes...</p> </>
{statChanges.map((change, index) => (
{change.label} 0 ? "#00ea00" : "red" }} className={styles["result-container__value-value"]} > {change.value > 0 ? "+" : ""} {(change.value * 100).toFixed()}%
))}

{text}

{homeConfig.pathFromHome === EPathsFromHome.breath && ( )} {homeConfig.pathFromHome === EPathsFromHome.compatibility && ( )}
); } export default UserCallbacksPage;