import { useMediaQuery, useTheme } from "@mui/material"; import React from "react"; import PropTypes from "prop-types"; import { useRef } from "react"; import arrow_left from "../../assets/images/arrow_left.png"; import arrow_right from "../../assets/images/arrow_right.png"; import Slider from "react-slick"; // import Ad from "../../components/Ads/Ad"; import { AD_DETAILS_PAGE } from "../../constants/pages"; import StatsAd from "../../components/Ads/StatsAd"; import { useDispatch } from "react-redux"; import { useSelector } from "react-redux"; import { useEffect } from "react"; import { getStatsReq } from "../../store/actions/stats/statsActions"; import { useTranslation } from "react-i18next"; import { returni18nLevel } from "../../util/helpers/stringHelpers"; // import ArchiveAd from "../../components/Ads/ArchiveAd"; // import { AD_DETAILS_PAGE } from "../../constants/pages"; const StatsPage = ({history}) => { const dispatch = useDispatch(); const { stats } = useSelector((s) => s.stats); const { t } = useTranslation(); useEffect(() => { dispatch(getStatsReq()); }, [dispatch]); const theme = useTheme(); const matches = useMediaQuery(theme.breakpoints.down("sm")); const sliderRef = useRef(); var settings = { dots: false, infinite: false, speed: 500, initialSlide: 0, responsive: [ { breakpoint: 1024, settings: { slidesToShow: 3, slidesToScroll: 3, infinite: false, dots: false, }, }, { breakpoint: 900, settings: { slidesToShow: 2, slidesToScroll: 2, initialSlide: 0, }, }, { breakpoint: 480, settings: { slidesToShow: 1, slidesToScroll: 1, }, }, ], }; const arrowLeftHandler = () => { sliderRef.current.slickPrev(); }; const arrowRightHandler = () => { sliderRef.current.slickNext(); }; return (

Statistika

Tok Selekcije

{stats.levels && stats.levels.map((n) => (

{n.countDone}

{returni18nLevel(n.level) != 'FD' && 'Obavljenih'}

{t('selectionLevels.done.'+returni18nLevel(n.level))}

))}

Odnosi

{stats.levels && stats.levels.map((n) => (

{n.countDone} : {n.countAll}

Broj {t('selectionLevels.done.'+returni18nLevel(n.level))}:

Broj kontaktiranih:

))}

Prijavljeni po pozicijama

{stats.ads && stats.ads.length > 0 && (
{/*

{t("ads.archiveAds")}

*/}
{!matches && (
{stats.ads.length > 3 && ( )}
)}
{stats.ads.map((ad, index) => ( history.push(AD_DETAILS_PAGE.replace(":id", ad.id)) } /> ))} {/* {stats.ads.length <= 5 && getDummyArchiveAds(archiveAds.length)} */}
{matches && (
{stats.ads.length > 2 && ( )}
)}
)}
); }; export default StatsPage; StatsPage.propTypes = { history: PropTypes.shape({ replace: PropTypes.func, push: PropTypes.func, location: PropTypes.shape({ pathname: PropTypes.string, }), }), };