diff --git a/src/components/TeaserCarousel.tsx b/src/components/TeaserCarousel.tsx index 6b4b00b..0fd59c6 100644 --- a/src/components/TeaserCarousel.tsx +++ b/src/components/TeaserCarousel.tsx @@ -15,66 +15,87 @@ type Slide = { const slides: Slide[] = [ { key: "compete", image: "/images/landing/compete_teaser.jpg", imageAlt: "Võistle", href: "/turniirid" }, - { key: "play", image: "/images/landing/play_teaser.png", imageAlt: "Mängi", href: "/piletid" }, - { key: "explore", image: "/images/landing/explore_teaser.png", imageAlt: "Avasta", href: "/messiala" }, + { key: "play", image: "/images/landing/play_teaser.png", imageAlt: "Mängi", href: "/piletid" }, + { key: "explore", image: "/images/landing/explore_teaser.png", imageAlt: "Avasta", href: "/messiala" }, ]; export default function TeaserCarousel() { const t = useTranslations("home.teaser"); const [current, setCurrent] = useState(0); - const slide = slides[current]; - const title = t(`${slide.key}.title`); - const description = t(`${slide.key}.description`); - const prize = t.raw(`${slide.key}.prize`) as string | null; + const prev = () => setCurrent((c) => (c - 1 + slides.length) % slides.length); + const next = () => setCurrent((c) => (c + 1) % slides.length); return (
- {description} -
-- {prize} -
- )} -+ {description} +
++ {prize} +
+ )} +