= ({ content, children, width = "au
return (
{children || (
- {
checkTooltipPosition();
setShowTooltip(true);
@@ -46,7 +56,7 @@ export const Tooltip: React.FC = ({ content, children, width = "au
className={`absolute left-1/2 -translate-x-1/2 z-50 bg-black/90 text-white p-2 rounded-md text-sm font-normal shadow-lg ${className}`}
style={{
[tooltipPosition === "top" ? "bottom" : "top"]: "100%",
- width: width,
+ width,
marginBottom: tooltipPosition === "top" ? "8px" : "0",
marginTop: tooltipPosition === "bottom" ? "8px" : "0",
}}
@@ -57,8 +67,14 @@ export const Tooltip: React.FC = ({ content, children, width = "au
style={{
top: tooltipPosition === "top" ? "100%" : "auto",
bottom: tooltipPosition === "bottom" ? "100%" : "auto",
- borderTop: tooltipPosition === "top" ? "6px solid rgba(0, 0, 0, 0.9)" : "6px solid transparent",
- borderBottom: tooltipPosition === "bottom" ? "6px solid rgba(0, 0, 0, 0.9)" : "6px solid transparent",
+ borderTop:
+ tooltipPosition === "top"
+ ? "6px solid rgba(0, 0, 0, 0.9)"
+ : "6px solid transparent",
+ borderBottom:
+ tooltipPosition === "bottom"
+ ? "6px solid rgba(0, 0, 0, 0.9)"
+ : "6px solid transparent",
borderLeft: "6px solid transparent",
borderRight: "6px solid transparent",
}}