import type { ReactNode } from 'react'; import React from 'react'; import { useScreenHasMinWidth } from '../../hooks/useScreenHasMinWidth'; import { Icon } from '../Icon/Icon'; import type { IconName } from '../Icon/IconName'; import { IconButton } from '../IconButton/IconButton'; import { Tooltip } from '../Tooltip/Tooltip'; export interface StatsCardProps { /** * The main value displayed in the stats card. * This is typically a numeric value or a string that represents a statistic. */ value: string; /** * The title displayed on the stats card. */ title: string; /** * Optional icon to display on the top left corner of the stats card. */ icon?: IconName; /** * Tooltip content to display when hovering over the info icon. */ tooltip?: ReactNode; /** * Optional description to display below the title. */ description?: string; } export const StatsCard: React.FC = ({ value, title, icon, tooltip, description, ...rest }) => { const isXLScreen = useScreenHasMinWidth('xl'); return (
{value}
{tooltip && ( )}
{icon && ( )}

{title}

{description &&

{description}

}
); };