import classNames from "classnames"; import React, { ReactNode } from "react"; import classes from "./classes.module.scss"; type IProps = { display: boolean; title?: React.ReactNode; event: React.MouseEvent | null; children?: ReactNode; }; export default class TooltipContent extends React.Component { public override render(): JSX.Element { const mousePositionX = this.props.event?.clientX; const mousePositionY = this.props.event?.clientY; let right = 0; let bottom = 0; if (typeof window !== "undefined") { right = window.innerWidth - (mousePositionX ?? 0) - 35; bottom = window.innerHeight - (mousePositionY ?? 0) + 15; } return (
{this.props.title &&
{this.props.title}
} {this.props.children}
); } }