mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Card: Render description element based on children type (#100276)
This commit is contained in:
parent
dfaa12b800
commit
53030e7960
@ -183,7 +183,8 @@ const getTagStyles = (theme: GrafanaTheme2) => ({
|
||||
/** Card description text */
|
||||
const Description = ({ children, className }: ChildProps) => {
|
||||
const styles = useStyles2(getDescriptionStyles);
|
||||
return <div className={cx(styles.description, className)}>{children}</div>;
|
||||
const Element = typeof children === 'string' ? 'p' : 'div';
|
||||
return <Element className={cx(styles.description, className)}>{children}</Element>;
|
||||
};
|
||||
Description.displayName = 'Description';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user