// import { listCarousel } from '@/service/landing/landing'; // import React, { useEffect, useRef, useState } from 'react' // import NewsTicker from "react-advanced-news-ticker"; // const NewsTicker = () => { // const [content, setContent] = useState([]); // const newsTickerRef = useRef(null); // useEffect(() => { // async function fetchCarouselData() { // try { // const response = await listCarousel(); // setContent(response.data?.data || []); // console.log('Carousel data:', response.data?.data); // } catch (error) { // console.error('Error fetching carousel data:', error); // } // } // fetchCarouselData(); // }, []); // function formatDateIndonesianWithTime(dateString: any) { // const options: any = { // year: 'numeric', // month: 'long', // day: 'numeric', // hour: 'numeric', // minute: 'numeric' // }; // const formattedDate = new Date(dateString).toLocaleDateString('id-ID', options); // return formattedDate.replace('pukul', '-'); // } // const dummyNews = Array.from({ length: 10 }, (_, index) => ({ // id: index + 1, // title: `Berita ${index + 1}`, // name: `Penulis ${index + 1}`, // })); // return ( //
//
// Breaking News //
//
// {content.length > 0 ? // ( // // {content.map((item: any) => ( // <> //
// // {item.title}. // //
//
// {formatDateIndonesianWithTime(item.createdAt)} //
// // ))} //
// ) : ( //

Loading...

// Tampilkan pesan "Loading..." saat data belum tersedia. // )} //
//
// // //
//
// ) // } // export default NewsTicker