import React from "react" import { cn } from "../../../utils/cn" import { noDataActionsVariants, noDataIconClasses, type NoDataActionsVariant } from "./no-data-styles" interface NoDataActionProps extends Omit, "title"> { /** Leading glyph, sized to 16px (mobile) / 24px (md+). Optional. */ icon?: React.ReactNode /** Short label describing the block. */ label?: React.ReactNode } /** * A single static info block: a leading icon with a short label, laid out * icon-beside-label on mobile and icon-above-label on larger screens. Purely * presentational — no hover or click. The outer border, rounded corners and * dividers come from the surrounding group. Capped at 244px wide on md+. */ const NoDataAction = React.forwardRef( function NoDataAction({ icon, label, children, className, ...props }, ref) { return (
{icon && {icon}} {label ?? children}
) }, ) interface NoDataActionsProps extends React.HTMLAttributes { /** The blocks to render. When omitted, `children` are rendered instead. */ actions?: NoDataActionProps[] /** Surface treatment of the group panel. */ variant?: NoDataActionsVariant } /** * A group of static info blocks sharing one transparent, bordered panel. Renders * as a horizontal row with vertical dividers on larger screens and a vertical * stack with horizontal dividers on mobile. Only the outermost blocks have * rounded corners. */ const NoDataActions = React.forwardRef( function NoDataActions({ actions, variant = "outline", className, children, ...props }, ref) { const blocks = actions ? actions.map((action, index) => ) : React.Children.toArray(children) return (
{blocks.map((block, index) => ( {index > 0 && ( ) }, ) export { NoDataAction, NoDataActions, type NoDataActionProps, type NoDataActionsProps }