Skip to content

Commit

Permalink
feat(EmptyState): fix coderabbit nitpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
JoannaSikora committed Jan 22, 2025
1 parent 7f8d86a commit ccb18f7
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export const WithCustomContentAndNoIllustration: Story = {
<div className={styles['empty-state-story__custom-content__row']}>
<div className={styles['empty-state-story__custom-content__box']}>
<Icon size="xlarge" source={FacebookIcon} />
<Text bold>Facebook Messanger</Text>
<Text bold>Facebook Messenger</Text>
</div>
<div className={styles['empty-state-story__custom-content__box']}>
<Icon size="xlarge" source={GoogleIcon} />
Expand Down
45 changes: 42 additions & 3 deletions packages/react-components/src/components/EmptyState/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
);

0 comments on commit ccb18f7

Please sign in to comment.