From 3c4e078bdd62bb57cc34f0c550c69426d49fb221 Mon Sep 17 00:00:00 2001 From: Noa Virellia Date: Fri, 6 Feb 2026 20:47:35 +0800 Subject: [PATCH] refactor(profile): update error display to use Empty component Signed-off-by: Noa Virellia --- .../src/components/profile/profile.error.tsx | 36 ++++++------------- .../src/stories/events/event-grid.stories.tsx | 2 +- .../src/stories/profile/profile.stories.tsx | 10 ++++++ 3 files changed, 22 insertions(+), 26 deletions(-) diff --git a/client/cms/src/components/profile/profile.error.tsx b/client/cms/src/components/profile/profile.error.tsx index 2f6f42a..da89243 100644 --- a/client/cms/src/components/profile/profile.error.tsx +++ b/client/cms/src/components/profile/profile.error.tsx @@ -1,30 +1,16 @@ -import { Mail } from 'lucide-react'; -import { Skeleton } from '../ui/skeleton'; +import { UserLock } from 'lucide-react'; +import { Empty, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from '../ui/empty'; export function ProfileError({ reason }: { reason: string }) { return ( -
-
-
-
-
- -
- - -
-
-
- - -
-
- -
-
- - {reason} - -
+ + + + + + 无法查看此个人资料 + {reason} + + ); } diff --git a/client/cms/src/stories/events/event-grid.stories.tsx b/client/cms/src/stories/events/event-grid.stories.tsx index 6762cf5..36c2e4d 100644 --- a/client/cms/src/stories/events/event-grid.stories.tsx +++ b/client/cms/src/stories/events/event-grid.stories.tsx @@ -65,7 +65,7 @@ export const Primary: Story = { }; export const Empty: Story = { - decorators: [Story =>
{Story()}
], + decorators: [Story =>
], args: { events: [], footer: () => , diff --git a/client/cms/src/stories/profile/profile.stories.tsx b/client/cms/src/stories/profile/profile.stories.tsx index 7590c49..8b3fe57 100644 --- a/client/cms/src/stories/profile/profile.stories.tsx +++ b/client/cms/src/stories/profile/profile.stories.tsx @@ -39,10 +39,20 @@ export const Loading: Story = { export const Error: Story = { render: () => , + decorators: [ + Story => ( +
+ +
+ ), + ], args: { user: { allow_public: false, }, onSaveBio: async () => Promise.resolve(), }, + parameters: { + layout: 'fullscreen', + }, };