import { Button } from '@nextui-org/button'; import { Image } from '@nextui-org/react'; import { ChevronLeftWhite, ChevronRightWhite } from '../icons'; import { useEffect, useState } from 'react'; export default function RegionalNews() { const [limitedData, setLimitedData] = useState([]); const list = [ { img: "/temp/poldametro.svg", title: "Polda Metro Jaya" }, { img: "/temp/polda-sumut.svg", title: "Polda Sumatra Utara" }, { img: "/temp/polda-banten.svg", title: "Polda Banten" }, { img: "/temp/polda-jateng.svg", title: "Polda Jawa Tengah" }, { img: "/temp/polda-jatim.svg", title: "Polda Jawa Timur" }, ]; // useEffect(() => { // function updateLimitedData() { // if (window.matchMedia("(max-width: 767px)").matches) { // setLimitedData(list.slice(0, 2)); // } else if (window.matchMedia("(min-width: 768px) and (max-width: 1023px)").matches) { // setLimitedData(list.slice(0, 3)); // } else { // setLimitedData(list.slice(0, 5)); // } // } // updateLimitedData(); // window.addEventListener('resize', updateLimitedData); // return () => { // window.removeEventListener('resize', updateLimitedData); // }; // }, [list]); return (
Berita Wilayah
{list.map((item: any, index: any) => (

{item.title}

))}
) }