From ccb18f77774cf148ee10892e15639005141d39da Mon Sep 17 00:00:00 2001 From: joannasikora Date: Mon, 20 Jan 2025 13:55:21 +0100 Subject: [PATCH] feat(EmptyState): fix coderabbit nitpicks --- .../EmptyState/EmptyState.stories.tsx | 2 +- .../src/components/EmptyState/types.ts | 45 +++++++++++++++++-- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/packages/react-components/src/components/EmptyState/EmptyState.stories.tsx b/packages/react-components/src/components/EmptyState/EmptyState.stories.tsx index fe3f09920..00a0671f2 100644 --- a/packages/react-components/src/components/EmptyState/EmptyState.stories.tsx +++ b/packages/react-components/src/components/EmptyState/EmptyState.stories.tsx @@ -137,7 +137,7 @@ export const WithCustomContentAndNoIllustration: Story = {
- Facebook Messanger + Facebook Messenger
diff --git a/packages/react-components/src/components/EmptyState/types.ts b/packages/react-components/src/components/EmptyState/types.ts index b806eae1d..89811babe 100644 --- a/packages/react-components/src/components/EmptyState/types.ts +++ b/packages/react-components/src/components/EmptyState/types.ts @@ -2,20 +2,59 @@ import { ReactNode } from 'react'; export type IEmptyStateProps = ( | { + /** + * Specify the empty state type + */ type?: 'full'; + /** + * The empty state description text or element + */ description?: string | ReactNode; } | { + /** + * Specify the empty state type + */ type: 'inline'; + /** + * Description is not available in inline type + */ description?: never; + /** + * Image is not available in inline type + */ image?: never; } ) & { + /** + * The empty state title + */ title: string; + /** + * Optional actions to be displayed + */ actions?: ReactNode; + /** + * Set to center the content + */ centered?: boolean; } & ( - | { image?: string; icon?: never } - | { image?: never; icon?: ReactNode } - | { image?: never; icon?: never } + | { + /** + * The URL of the empty state image + */ + image?: string; + icon?: never; + } + | { + image?: never; + /** + * The icon element to be displayed + */ + icon?: ReactNode; + } + | { + image?: never; + icon?: never; + } );