"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var s=require("../../../../_virtual/jsx-runtime.js"),l=require("react"),u=require("./styles.js"),b=require("../../../../hooks/useHasFocus.js");function f({segment:e,active:r,size:t,segmentPadding:a,onChange:o,setActiveRef:c}){const i=l.useRef(null),{hasFocus:n}=b.useHasFocus(i);l.useEffect(()=>{r&&c(i)},[r]);function d(){!e.disabled&&o(e)}return s.jsxRuntimeExports.jsx(u.SegmentWrapper,{ref:i,"aria-selected":r,role:"tab",isActive:r,size:t,segmentPadding:a,hasFocus:n,disabled:e.disabled,onClick:d,children:s.jsxRuntimeExports.jsxs(u.SegmentLabel,{title:e.tooltip,children:[e.icon,e.label]})},e.id??e.label)}exports.Segment=f;
