Files
nocturne/app/blog/BlogPostCard.tsx
lumither 603dbf71a6 feat(blog) add CMS, render blog posts list
- use GitHub repo as cms, read idx.json
- blog posts list
2024-04-27 12:03:08 +08:00

34 lines
874 B
TypeScript

import React from 'react';
import Link from 'next/link';
import { Card, CardBody, CardHeader } from '@nextui-org/card';
import { Divider } from '@nextui-org/react';
type Props = {
post: JSON
}
function BlogPostCard({ post }: Props) {
const name = (post as any)['name'];
const { title, desc } = (post as any)['meta'] as { title: string, desc: string };
return (
<div>
{/*todo: to be update*/ }
{/*<Link href={ `/blog/${ name }` }>*/}
<Card>
<CardHeader>
<p className={ 'font-bold' }>{ title }</p>
</CardHeader>
<Divider />
<CardBody>
{ desc }
</CardBody>
</Card>
{/*</Link>*/}
</div>
);
}
export default BlogPostCard;