ab_frontend_3/src/app/components/LastFiveStories.tsx

19 lines
637 B
TypeScript
Raw Normal View History

2024-09-06 22:04:19 +10:00
import Link from 'next/link'
export default function LastFiveStories({storyList}: {storyList: any}) {
return (
<div className="w-full md:w-1/4 px-4">
<div className="bg-gray-100 p-4">
<h2 className="text-xl font-bold text-gray-800 mb-4">Recent Posts</h2>
<ul className="list-none">
{storyList.data.map((story: any) => (
<li className="mb-2">
<Link href="/news/[slug]" as={"/news/" + story.attributes.Slug}>{story.attributes.Title}</Link>
</li>
))}
</ul>
</div>
</div>
)
}