import { addPxToValue, getTruncatedText } from '../../global-utils/GlobalUtils'
import PrimitiveText from '../Primitives/PrimitiveText/PrimitiveText'
import { Tooltip } from '../Tooltip'
import { SelectorsSubLabelProps } from './SelectorsContent.types'
const SelectorsSubLabel = ({
id,
subLabel,
size,
disabled,
error,
tokens,
maxLength,
elementType = 'subLabel',
}: SelectorsSubLabelProps) => {
if (!subLabel) return null
const { truncatedValue, fullValue, isTruncated } = getTruncatedText(
subLabel,
maxLength
)
const content = (
{isTruncated ? truncatedValue : subLabel}
)
if (isTruncated) {
return {content}
}
return content
}
SelectorsSubLabel.displayName = 'SelectorsSubLabel'
export default SelectorsSubLabel