"use client"; import { Card, CardFooter } from "@heroui/react"; import Image from "next/image"; import { useEffect, useState } from "react"; import { ChevronLeftWhite, ChevronRightIcon, EyeIcon } from "../icons"; import Link from "next/link"; import { getListArticle } from "@/services/article"; import { convertDateFormat, textEllipsis } from "@/utils/global"; import { Autoplay, Pagination, Navigation } from "swiper/modules"; import { Swiper, SwiperSlide } from "swiper/react"; import "swiper/css"; import "swiper/css/pagination"; import "swiper/css/effect-fade"; import "swiper/css/navigation"; import { getListMagazine } from "@/services/magazine"; export default function ENewsPolri() { const [article, setArticle] = useState([]); useEffect(() => { async function getArticle() { const req = { page: 1, search: "", limit: "10" }; const response = await getListMagazine(req); setArticle(response?.data?.data); } getArticle(); }, []); return (

E-Majalah Polri

{ swiper.navigation.nextEl?.classList.add( "bg-white/70", "!text-black", "rounded-full", "!w-[40px]", "!h-[40px]" ); swiper.navigation.prevEl?.classList.add( "bg-white/70", "!text-black", "rounded-full", "!w-[40px]", "!h-[40px]" ); }} > {article?.map((newsItem: any) => ( thumbnail

{textEllipsis(newsItem.title, 40)}

{convertDateFormat(newsItem.createdAt)} WIB

{newsItem.viewCount === null ? 0 : newsItem.viewCount}

))}
Lihat Semua
); }