"use client"; import { Button } from "@/components/ui/Button"; import { Carousel } from "@/components/ui/Carousel"; import { Section } from "@/components/ui/Section"; import { Heading, Text } from "@/components/ui/Typography"; import { useTranslation } from "@/lib/hooks/useTranslation"; import { CarouselSlide } from "@/lib/types/carousel"; import { container } from "@/lib/utils"; import Image from "next/image"; export default function HeroCarousel() { const { t } = useTranslation(); // Carousel data with translations const carouselData: CarouselSlide[] = [ { id: 1, title: t('hero.title'), titleColored: t('hero.title_colored'), titleEnd: t('hero.title_end'), description: t('hero.description'), buttonText: t('hero.build_box_button'), buttonLink: "/build-box", imageSrc: "/assets/images/carousel1.png" }, { id: 2, title: t('hero.title'), titleColored: t('hero.title_colored'), titleEnd: t('hero.title_end'), description: t('hero.description'), buttonText: t('hero.build_box_button'), buttonLink: "/build-box", imageSrc: "/assets/images/carousel2.png" }, { id: 3, title: t('hero.title'), titleColored: t('hero.title_colored'), titleEnd: t('hero.title_end'), description: t('hero.description'), buttonText: t('hero.build_box_button'), buttonLink: "/build-box", imageSrc: "/assets/images/carousel1.png" } ]; // Default slide to use as fallback const defaultSlide: CarouselSlide = { id: 0, title: t('hero.title'), titleColored: t('hero.title_colored'), titleEnd: t('hero.title_end'), description: t('hero.description'), buttonText: t('hero.build_box_button'), buttonLink: "/build-box", imageSrc: "/assets/images/image1.png" }; // Create mobile slide components - each image needs to be in a container div const mobileImageSlides = carouselData.map((slide, index) => (
{/* Background gradient */}
{/* Image container - right side with padding */}
{slide.title}
)); // Create desktop slide components const desktopSlides = carouselData.map((slide, index) => (
{/* Background gradient */}
{/* Image container - positioned on the right with padding */}
{slide.title}
{/* Container for proper alignment */}
{/* Text overlay */}
{slide.title} {slide.titleColored} {slide.titleEnd} {slide.description}
)); return (
{/* Mobile version */}
{/* Image carousel */}
{/* Text content below carousel on mobile */}
{carouselData[0]?.title || defaultSlide.title} {carouselData[0]?.titleColored || defaultSlide.titleColored} {carouselData[0]?.titleEnd || defaultSlide.titleEnd} {carouselData[0]?.description || defaultSlide.description}
{/* Desktop version */}
); }