import { Tooltip } from '@vegaprotocol/ui-toolkit'; import type { ReactElement, ReactNode } from 'react'; import { Children } from 'react'; import { cloneElement } from 'react'; interface TradeMarketHeaderProps { title: ReactNode; children: Array; } export const Header = ({ title, children }: TradeMarketHeaderProps) => { return (
{title}
{Children.map(children, (child, index) => { if (!child) return null; return cloneElement(child, { id: `header-stat-${index}`, }); })}
); }; export const HeaderStat = ({ children, heading, id, description, testId, }: { children: ReactNode; heading: string; id?: string; description?: string | ReactNode; testId?: string; }) => { const itemClass = 'min-w-min w-[120px] whitespace-nowrap pb-3 px-4 border-l border-default mt-1'; const itemHeading = 'text-neutral-500 dark:text-neutral-400'; return (
{heading}
{children}
); };