"use client"; import Image from "next/image"; import { useRef, useState } from "react"; import { Card, Typography } from "poyraz-ui/atoms"; import { NewsCard } from "poyraz-ui/molecules"; import { useTranslations } from "next-intl"; type HomeHeroProps = { news: { id: string; category: string; title: string; date: string; image: string; href: string; }[]; }; export function HomeHero({ news }: HomeHeroProps) { const [frame, setFrame] = useState<1 | 2>(1); const intervalRef = useRef | null>(null); const t = useTranslations("Home"); const handleMouseEnter = () => { if (intervalRef.current) return; intervalRef.current = setInterval(() => { setFrame((prev) => (prev === 1 ? 2 : 1)); }, 260); }; const handleMouseLeave = () => { if (intervalRef.current) { clearInterval(intervalRef.current); intervalRef.current = null; } setFrame(1); }; return (
{news.map((item) => (
))}
Poyraz{" "} Avsever
{t.rich("role", { strong: (chunks) => ( {chunks} ), })}
Poyraz Avsever
); }