// // Copyright 2026 DXOS.org // import React from 'react'; import { useTranslation } from 'react-i18next'; import { translationKey } from '#translations'; import { recipes } from '../../recipes.ts'; import { composable, composableProps } from '../../util/slots.ts'; import * as Icon from '../Icon/Icon.tsx'; export type EmptyProps = { /** A Phosphor icon above the message; decorative, since the message carries the statement. */ icon?: string; }; /** * Stands in for content that is not there (no items, no selection, no result): a centred status message, its text the * children or the translated "No items". Composites build their own `Empty` part on it. */ export const Empty = composable(({ children, icon, ...props }, forwardedRef) => { const { t } = useTranslation(translationKey); const { className, ...rest } = composableProps(props, { classNames: recipes.empty(), role: 'status', }); return (
{icon && }

{children ?? t('empty.label')}

); }); Empty.displayName = 'Empty';