fix(frontend/Blog) fix compatibility with new backend

This commit is contained in:
lumither committed 2024-05-04 00:51:32 +08:00
1 parent b17e8a19eb
commit a9ba365bac
3 files changed
+42 -46

No files matched your search

+19 -14
View File
@@ -1,5 +1,4 @@
import React from 'react';
import Link from 'next/link';
import { Card, CardBody, CardHeader } from '@nextui-org/card';
import { Divider } from '@nextui-org/react';
@@ -8,23 +7,29 @@ type Props = {
}
function BlogPostCard({ post }: Props) {
const name = (post as any)['name'];
const { title, desc } = (post as any)['meta'] as { title: string, desc: string };
let title = (post as any)['title'];
let summary = (post as any)['summary'];
let last_update = (post as any)['last_update'];
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>*/}
{/*<Link href={ `/blog/${ name }` }>*/ }
<Card>
<CardHeader>
<p className={ 'font-bold' }>{ title }</p>
</CardHeader>
<Divider />
<CardBody>
{ summary }
</CardBody>
<Divider />
<CardBody>
{ last_update }
</CardBody>
</Card>
{/*</Link>*/ }
</div>
);