import wn from '../../../../../../node_modules/preact/compat/dist/compat.module.mjs';
import styled from '../../../../../../node_modules/@mui/material/styles/styled.mjs';
import { useState as h } from '../../../../../../node_modules/preact/hooks/dist/hooks.module.mjs';
import Tooltip from '../../../../../../node_modules/@mui/material/Tooltip/Tooltip.mjs';

const HoverTarget = styled('span')({
    display: 'flex',
    cursor: 'pointer'
});
const TooltipCore = ({ text, children, disabled, open, placement = 'right', TypographyComponent: Typography })=>{
    const [isOpen, setIsOpen] = h(open);
    if (disabled) {
        return children;
    }
    return /*#__PURE__*/ wn.createElement(Tooltip, {
        onClose: ()=>setIsOpen(false),
        onOpen: ()=>setIsOpen(true),
        open: isOpen,
        placement: placement,
        title: /*#__PURE__*/ wn.createElement(Typography, {
            variant: "body2"
        }, text)
    }, /*#__PURE__*/ wn.createElement(HoverTarget, null, children));
};

export { TooltipCore };
//# sourceMappingURL=Tooltip.mjs.map
