import e,{useState as t,useCallback as l}from"react";import{withEllipsis as a}from"../../utils/stringUtils.js";import{Select as n,SelectTrigger as s,SelectValue as r,SelectContent as c,SelectItem as o}from"../../node_modules/@cortexapps/react-plugin-ui/dist/index.js";const i=(e="")=>"string"==typeof e?a(e,30):e,d=({defaultSelected:a,defaultText:d,disabled:m,label:u,light:p,onReset:g,onSelect:f,options:y,selected:E,showReset:S=!1,size:b="md",truncateText:h=!0,tight:x})=>{const[k,v]=t(!1),C=l((e=>y.find((t=>t.key===e)).label),[y]),T=E?C(E):a?C(a):d,j=h?i(T):T;return e.createElement(n,{disabled:m,open:k,onOpenChange:v,onValueChange:f,value:E},e.createElement(s,null,e.createElement(r,{placeholder:j})),e.createElement(c,null,y.map((t=>{const{icon:l}=t;return e.createElement(o,{key:t.key,value:t.key},e.createElement("div",{style:{alignItems:"center",display:"flex",gap:4}},l&&e.createElement(l,null),h?i(t.label):t.label))}))))};export{d as default};
//# sourceMappingURL=Dropdown.js.map
