truncatedLabel.tsx 405 B

123456789101112131415
  1. import Truncate from 'sentry/components/truncate';
  2. import theme from 'sentry/utils/theme';
  3. import useMedia from 'sentry/utils/useMedia';
  4. type Props = {
  5. value: string;
  6. };
  7. export function TruncatedLabel({value}: Props) {
  8. const isSmallDevice = useMedia(`(max-width: ${theme.breakpoints.small})`);
  9. return (
  10. <Truncate value={value} maxLength={isSmallDevice ? 30 : 40} expandable={false} />
  11. );
  12. }