🐛 fix(parameterComponent): fix styling issue in tooltip and icon rendering in ParameterComponent

This commit is contained in:
Cristhian Zanforlin Lousa 2023-07-04 19:24:37 -03:00
commit 3f0cc57cd5

View file

@ -100,24 +100,32 @@ export default function ParameterComponent({
const groupedObj = groupByFamily(myData, tooltipTitle, left, data.type);
refHtml.current = groupedObj.map((item, i) => {
const Icon: any = nodeIconsLucide[item.family];
return (
<span
key={getRandomKeyByssmm() + item.family + i}
className={classNames(
i > 0 ? "mt-3 flex items-center" : "flex items-center"
i > 0 ? "mt-2 flex items-center" : "flex items-center"
)}
>
<div
className="h-6 w-6"
className="h-5 w-5"
style={{
color: nodeColors[item.family],
}}
>
{React.createElement(nodeIconsLucide[item.family])}
<Icon
className="h-5 w-5"
strokeWidth={1.5}
style={{
color: nodeColors[item.family] ?? nodeColors.unknown,
}}
/>
</div>
<span className="ps-2 text-foreground">
<span className="ps-2 text-xs text-foreground">
{nodeNames[item.family] ?? ""}{" "}
<span>
<span className="text-xs">
{" "}
-&nbsp;
{item.type.split(", ").length > 2
@ -136,7 +144,6 @@ export default function ParameterComponent({
</span>
);
});
}, [tooltipTitle]);
return (
@ -174,7 +181,7 @@ export default function ParameterComponent({
<></>
) : (
<ShadTooltip
style="max-w-[40vw] max-h-[10vh] overflow-auto custom-scroll"
style="max-w-[30vw] max-h-[20vh] overflow-auto custom-scroll"
delayDuration={0}
content={refHtml.current}
side={left ? "left" : "right"}