import React from "react"; import Link from "next/link"; import Image from "next/image" import { ModuleWithInit, AgilityImage } from '@agility/nextjs' import products from "pages/api/catalog/products"; interface ICustomData { posts: [] } interface IModule { } const PostsListing: ModuleWithInit = ({ customData, module, languageCode, isDevelopmentMode, isPreview }) => { // get posts const { posts } = customData; // set up href for internal links let href = "/pages/[...slug]"; // if there are no posts, display message on frontend if (posts.length <= 0) { return (

No posts available.

Return Home
); } return (
{posts.map((post: any, index) => (
{post.productName}
{post.productName}
{post.date}

{post.title}

))}
); }; export default PostsListing;