import React from 'react';
import cx from 'classnames';
import type { MetricRunInfo } from '@bundle-stats/utils';
import css from './tile-group-title.module.css';
interface TileGroupTitleContentProps {
title?: string;
runInfo?: MetricRunInfo;
}
const TileGroupTitleContent = (props: TileGroupTitleContentProps) => {
const { title, runInfo } = props;
return (
{title && {title}}
{runInfo && (
{runInfo.displayValue}
{'displayDelta' in runInfo && `(${runInfo.displayDeltaPercentage})`}
)}
);
};
export type TileGroupTitleProps = TileGroupTitleContentProps & {
/**
* Node id - used to resolve the tooltip content on hover
*/
id: string;
/**
* Fill the group height - when the title is missing or the group does not render any children
*/
fill?: boolean;
};
export const TileGroupTitle = (props: TileGroupTitleProps) => {
const { id, fill = false, ...restProps } = props;
return (
);
};