import type { ReactNode } from 'react';
import React from 'react';
import Typography from '../../Typography';
import { LegendCircle, LegendItem, LegendValue } from './StyledLegend';
import { getTextComponent } from './utils';
import type { SegmentedBarLegendDisplayValue } from './types';
interface ProgressSegmentedBarLegendItemProps {
title: string;
color: string;
displayValue?: SegmentedBarLegendDisplayValue;
testID?: string;
}
const ProgressSegmentedBarLegendItem = ({
title,
color,
displayValue,
testID,
}: ProgressSegmentedBarLegendItemProps): ReactNode => {
const renderedDisplayValue = getTextComponent(
displayValue,
{displayValue}
);
return (
{`${title}:`}
{renderedDisplayValue ? (
{renderedDisplayValue}
) : null}
);
};
export default ProgressSegmentedBarLegendItem;