use span if the value of the header label content is not string, to remove warnings from validateDomNesting

Signed-off-by: Morgan Bentell <mbentell@spotify.com>
This commit is contained in:
Morgan Bentell
2023-03-01 13:39:54 +01:00
parent f41478fd02
commit 08048a5a8b
@@ -50,9 +50,16 @@ type HeaderLabelContentProps = {
className: string;
};
const HeaderLabelContent = ({ value, className }: HeaderLabelContentProps) => (
<Typography className={className}>{value}</Typography>
);
const HeaderLabelContent = ({ value, className }: HeaderLabelContentProps) => {
return (
<Typography
component={typeof value === 'string' ? 'p' : 'span'}
className={className}
>
{value}
</Typography>
);
};
type HeaderLabelProps = {
label: string;