🐛 fix: Update Empty component to support border prop and adjust usage in various pages

This commit is contained in:
web
2025-09-23 05:46:21 -07:00
parent bb0a811432
commit ce9ab89c1c
6 changed files with 26 additions and 22 deletions
@@ -3,9 +3,6 @@
import { Empty } from '@/components/empty';
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({
@@ -20,16 +17,5 @@ export default function Page() {
return data.data?.announcements || [];
},
});
return data && data.length > 0 ? (
<Timeline
data={
data.map((item) => ({
title: String(formatDate(item.created_at, false)),
content: <Markdown>{`### ${item.title}\n${item.content}`}</Markdown>,
})) || []
}
/>
) : (
<Empty />
);
return data && data.length > 0 ? <Empty border /> : <Empty border />;
}