"use client"; import { useState } from "react"; import Image from "next/image"; import { ChevronLeft, ChevronRight } from "lucide-react"; const locations = [ { name: "Jaecoo 1S Kelapa Gading", address: "Jl. Boulevard Raya Blok LA 6 No. 34-35, Kelapa Gading, Jakarta Utara 14240", region: "Kelapa Gading, Jakarta", image: "/loc1.png", }, { name: "Jaecoo Cihampelas Bandung", address: "Jl. Cihampelas No. 264-268, Bandung, Jawa Barat 40131", region: "Cihampelas, Bandung", image: "/loc2.png", }, { name: "Jaecoo 2S Kelapa Gading", address: "Jl. Pegangsaan Dua No.17 B, Kelapa Gading, Jakarta Utara 14250", region: "Kelapa Gading, Jakarta", image: "/loc3.png", }, ]; export default function Location() { const [currentPage, setCurrentPage] = useState(1); const perPage = 3; const totalPages = Math.ceil(locations.length / perPage); const paginated = locations.slice( (currentPage - 1) * perPage, currentPage * perPage ); const handlePrev = () => { if (currentPage > 1) setCurrentPage(currentPage - 1); }; const handleNext = () => { if (currentPage < totalPages) setCurrentPage(currentPage + 1); }; return (

Cari Store Lain

{" "}
{paginated.map((store, index) => (
{store.name}

{store.name}, {store.address}

{store.region}

))}
{[...Array(totalPages)].map((_, idx) => ( ))}
); }