import { Container } from "@/components/layout"; import { Button } from "@/components/ui/button"; import { useLangStore } from "@/store/lang"; import Autoplay from "embla-carousel-autoplay"; import useEmblaCarousel from "embla-carousel-react"; import { useTranslation } from "react-i18next"; import { Link, useLocation } from "react-router-dom"; const Hero = () => { const { t } = useTranslation("main"); const lang = useLangStore((state) => state.lang); const { pathname } = useLocation(); const [emblaRef] = useEmblaCarousel( { loop: true, }, [ Autoplay({ delay: 5000, stopOnInteraction: false, }), ] ); const { title, texts, button, button2 } = t("impressions.hero", { returnObjects: true, }) as { title: string; texts: string[]; button: string; button2: string }; const { title2, texts2 } = t("impressions.hero", { returnObjects: true, }) as { title2: string; texts2: string[]; }; const filterText = (value: any, value2: string) => { if (pathname === "/impressions") return value; else return value2; }; const filterTextArr = (value: string[], value2: string[]) => { if (pathname === "/impressions") return value; else return value2; }; const banners = [ "https://turkmentextile.turkmenexpo.com/app/storage/app/media/new2/eng1.jpg", "https://turkmentextile.turkmenexpo.com/app/storage/app/media/new2/eng2.jpg", ]; return (
{pathname === "/impressions-tm" ? (
{banners.map((banner, i) => ( imperssions ))}
) : ( )}

Модные показы

{filterText(title, title2)}

{filterTextArr(texts, texts2)?.map((item, i) => (

{item}

))}
); }; export default Hero;