import { CSSProperties, useRef, useState } from "react"; import { Tooltip } from "@mantine/core"; import cellClasses from "@/ee/base/styles/cells.module.css"; type ChoiceBadgeProps = { name: string; style: CSSProperties; }; export function ChoiceBadge({ name, style }: ChoiceBadgeProps) { const ref = useRef(null); const [truncated, setTruncated] = useState(false); return ( { const el = ref.current; if (el) setTruncated(el.scrollWidth > el.clientWidth); }} > {name} ); }