import type { ComponentPropsWithoutRef } from 'react'; import { Children, forwardRef } from 'react'; import classNames from 'classnames'; import { LoadingIndicator } from '../loading_indicator'; export const Scrollable = forwardRef< HTMLDivElement, ComponentPropsWithoutRef<'div'> & { flex?: boolean; fullscreen?: boolean; } >(({ flex = true, fullscreen, className, children, ...otherProps }, ref) => { return (
{children}
); }); Scrollable.displayName = 'Scrollable'; export const ItemList = forwardRef< HTMLDivElement, ComponentPropsWithoutRef<'div'> & { isLoading?: boolean; emptyMessage?: React.ReactNode; } >(({ isLoading, emptyMessage, className, children, ...otherProps }, ref) => { if (Children.count(children) === 0 && emptyMessage) { return
{emptyMessage}
; } return ( <>
{!isLoading && children}
{isLoading && (
)} ); }); ItemList.displayName = 'ItemList'; export const Article = forwardRef< HTMLElement, ComponentPropsWithoutRef<'article'> & { focusable?: boolean; 'data-id'?: string; 'aria-posinset': number; 'aria-setsize': number; } >(({ focusable, className, children, ...otherProps }, ref) => { return (
{children}
); }); Article.displayName = 'Article';