import{jsx as t}from"react/jsx-runtime";import{useEffect as s,useState as i}from"react";import{Button as a}from"@redocly/theme/components/Button/Button";import{Tooltip as m}from"@redocly/theme/components/Tooltip/Tooltip";import{InformationIcon as c}from"@redocly/theme/icons/InformationIcon/InformationIcon";const v=({description:n})=>{const[o,e]=i(!1);return s(()=>{const r=()=>{o&&e(!1)};if(o)return document.addEventListener("touchmove",r,{passive:!0}),()=>{document.removeEventListener("touchmove",r)}},[o]),t(m,{tip:n,placement:"bottom",arrowPosition:"left",isOpen:o,children:t(a,{size:"small",variant:"ghost",icon:t(c,{}),"data-testid":"server-item-description-tooltip",onClick:()=>e(!0),onBlur:()=>e(!1),onFocus:()=>e(!0),onMouseEnter:()=>e(!0),onMouseLeave:()=>e(!1),onTouchCancel:()=>e(!1)})})};export{v as ServerDescriptionTooltip};
