//WORDPRESS //import { Fade, Slide } from 'react-awesome-reveal' import Container from 'components/BlogContainer' import Layout from 'components/Layout' //import axios from "axios" import type { Settings } from 'lib/sanity.queries' import { getPage, getPaginationStatic } from 'lib/wordpress.data' import Image from 'next/image' import Link from 'next/link' import uniqid from 'uniqid' import { NextSeo } from 'next-seo' import { format, parseISO } from 'date-fns' import { IoCalendarOutline, IoNewspaperOutline } from 'react-icons/io5' import { GetServerSideProps } from 'next' import { getImageLink } from '../../../lib/wordpress.image' import { Latestpost } from '../../../lib/wordpress.queries' export interface NewsRoomPageProps { preview?: boolean newsroomposts: Latestpost[] loading?: boolean settings: Settings } const NO_POSTS: Latestpost[] = [] const url = 'https://cmswp.gwkbali.com/wp-json/wp/v2/monthly-release/' export default function page(props) { const { loading, newsroomposts, newsroompost, settings, preview, paginations, } = props return ( <>

Monthly Update

 News and Articles

{/*

A regularly published articles about Garuda Wisnu Kencana Statue

*/}
{/* */}
<> {newsroomposts.slice(0, 9).map((newsroompost) => { return (
{newsroompost.title.rendered}

  {format(new Date(newsroompost.date), 'dd-MM-yyyy')}
Read more
) })}
    {paginations.map((page) => { //console.log(uniqid) return (
  • {page.page}
  • ) })}
{/* */} ) } export const getServerSideProps: GetServerSideProps = async ({ params }:any) => { console.log('params', params) let pagehal = params && params.page ? Number(params.page) : 1 const { posts, paginations } = await getPage( url, '/monthly-release/page/', pagehal ) return { props: { newsroomposts: posts, paginations, pageActive: pagehal, }, } } // export async function getStaticPaths() { // const paginations = await getPaginationStatic(url) // return { // paths: paginations, // fallback: false, // } // }