From d2b51b3e89394b51913911e287a867e1a725056a Mon Sep 17 00:00:00 2001 From: John Doe Date: Tue, 12 Sep 2023 17:13:12 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=AF=20Update=20WidgetPosts=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update widgetPostsDemo to filter posts between index 3 and 6. Add viewAll prop to WidgetHeading1 component. --- src/app/blog/WidgetPosts.tsx | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/app/blog/WidgetPosts.tsx diff --git a/src/app/blog/WidgetPosts.tsx b/src/app/blog/WidgetPosts.tsx new file mode 100644 index 0000000..c6d1a7d --- /dev/null +++ b/src/app/blog/WidgetPosts.tsx @@ -0,0 +1,39 @@ +import { DEMO_POSTS } from "@/data/posts"; +import { PostDataType } from "@/data/types"; +import React, { FC } from "react"; +import Card3Small from "./Card3Small"; +import WidgetHeading1 from "./WidgetHeading1"; + +export interface WidgetPostsProps { + className?: string; + posts?: PostDataType[]; +} + +const widgetPostsDemo: PostDataType[] = DEMO_POSTS.filter( + (_, i) => i > 2 && i < 7 +); + +const WidgetPosts: FC = ({ + className = "bg-neutral-100 dark:bg-neutral-800", + posts = widgetPostsDemo, +}) => { + return ( +
+ +
+ {posts.map((post) => ( + + ))} +
+
+ ); +}; + +export default WidgetPosts;