import React, { type HTMLAttributes } from 'react' import classnames from 'classnames' import { Heading, type HeadingProps } from '~components/Heading' import { EmptyStatesInformative, EmptyStatesNegative, EmptyStatesNeutral, EmptyStatesPositive, type AnimatedSceneProps, } from '~components/Illustration' import { Text } from '~components/Text' import { type OverrideClassName } from '~components/types/OverrideClassName' import styles from './EmptyState.module.css' const ILLUSTRATIONS: Record JSX.Element> = { 'success': EmptyStatesPositive, 'warning': EmptyStatesNegative, 'informative': EmptyStatesInformative, 'expert-advice': EmptyStatesNeutral, } export type EmptyStateProps = { children?: React.ReactNode id?: string variant?: 'success' | 'warning' | 'informative' | 'expert-advice' bodyText: string | React.ReactNode straightCorners?: boolean headingProps?: HeadingProps } & OverrideClassName> & Pick /** * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3082094098/Empty+State Guidance} | * {@link https://cultureamp.design/?path=/docs/components-empty-state--docs Storybook} */ export const EmptyState = ({ children, id, variant = 'informative', headingProps, bodyText, straightCorners, isAnimated = true, loop = false, classNameOverride, ...props }: EmptyStateProps): JSX.Element => { const IllustrationComponent = ILLUSTRATIONS[variant] return ( {isAnimated ? ( ) : ( )} {headingProps && } {bodyText} {children && {children}} ) } EmptyState.displayName = 'EmptyState'