From 86b482c19e521f7f4b0284a465780b71e34c9f41 Mon Sep 17 00:00:00 2001 From: Justin Sun Date: Mon, 3 Apr 2023 01:07:28 +0800 Subject: [PATCH] feat: add content length --- src/api/types.ts | 1 + src/components/PostCard.tsx | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/api/types.ts b/src/api/types.ts index 09374a2..b4188aa 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -15,6 +15,7 @@ export type Post = { date: string; link: string; tags: string; + content_length: number; // id_feed: string; // lastSeen: string; }; diff --git a/src/components/PostCard.tsx b/src/components/PostCard.tsx index cd26641..d1d5c5e 100644 --- a/src/components/PostCard.tsx +++ b/src/components/PostCard.tsx @@ -1,4 +1,8 @@ -import { CalendarOutlined, UserOutlined } from '@ant-design/icons'; +import { + CalendarOutlined, + EditOutlined, + UserOutlined, +} from '@ant-design/icons'; import { Card, Tag } from 'antd'; import dayjs from 'dayjs'; @@ -23,6 +27,9 @@ const PostCard = ({ post }: { post: Post }) => { } color={PRIMARY_COLOR}> {dayjs.unix(Number(post.date)).format('YYYY/MM/DD HH:mm:ss')} + } color={PRIMARY_COLOR}> + 约 {post.content_length} 字 +
{post.content}
{post.tags && (