import { memo } from 'react'; import clsx from 'clsx'; import Grid from '@mui/material/Grid'; import { styled } from '@mui/material/styles'; import type { ClassNameMap } from '@mui/styles/withStyles'; import { CustomIcon } from '../custom-icon'; import type { Theme } from '../@styles/theme-provider'; import { TextWithTooltip } from '../text-with-tooltip'; const StyledIcon = styled(CustomIcon)(({ theme }: { theme: Theme }) => ({ marginRight: theme.spacing(1), color: theme.palette.primary[400], display: 'flex' })); const StyledText = styled('div')(({ theme }: { theme: Theme }) => ({ color: theme.palette.primary[500], display: 'flex', alignItems: 'center' })); export interface TextWithIconProps { /** * The src of the icon. */ src: string; /** * Text to display. */ text: string; /** * Width of the Box. */ width?: number; /** * Flag for truncating the text. */ truncateText?: boolean; /** * Custom class name in case you need to add custom styles to the component. */ className?: string; /** * Override classes. */ classes?: Partial>; } const TextWithIcon = (props: TextWithIconProps) => { const { src, text, width = 0, truncateText, className, classes } = props; return ( {truncateText ? ( ) : ( {text} )} ); }; const m = memo(TextWithIcon); export { m as TextWithIcon };