Files
Ashley Harrison b23b6d228a Chore: Convert styles to use emotion object syntax (#94989)
* convert to use emotion object syntax

* missed one

* review comments

* set back to 0 and disable lint rule
2024-10-23 15:25:28 +01:00

20 lines
592 B
TypeScript

import { css } from '@emotion/css';
import * as React from 'react';
import { GrafanaTheme2 } from '@grafana/data';
import { useStyles2 } from '@grafana/ui';
const getStyles = (theme: GrafanaTheme2) =>
css({
padding: theme.spacing(0, 2),
fontSize: theme.typography.bodySmall.fontSize,
color: theme.colors.text.secondary,
overflow: 'hidden',
textOverflow: 'ellipsis',
});
export const DetailText = ({ children }: React.PropsWithChildren<{}>) => {
const collapsedTextStyles = useStyles2(getStyles);
return <div className={collapsedTextStyles}>{children}</div>;
};