🐛 fix: Update announcement page to format creation date and enhance content display
This commit is contained in:
@@ -5,6 +5,7 @@ import { queryAnnouncement } from '@/services/user/announcement';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { Timeline } from '@workspace/ui/components/timeline';
|
||||
import { Markdown } from '@workspace/ui/custom-components/markdown';
|
||||
import { formatDate } from '@workspace/ui/utils';
|
||||
|
||||
export default function Page() {
|
||||
const { data } = useQuery({
|
||||
@@ -23,8 +24,8 @@ export default function Page() {
|
||||
<Timeline
|
||||
data={
|
||||
data.map((item) => ({
|
||||
title: item.title,
|
||||
content: <Markdown>{item.content}</Markdown>,
|
||||
title: String(formatDate(item.created_at, false)),
|
||||
content: <Markdown>{`### ${item.title}\n${item.content}`}</Markdown>,
|
||||
})) || []
|
||||
}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user