import{ChevronDownIcon as l}from"@chakra-ui/icons";import{Box as p,Button as P,Flex as s,Popover as w,PopoverBody as B,PopoverContent as b,PopoverTrigger as h,Text as n}from"@chakra-ui/react";import"react";import{jsx as r,jsxs as v}from"react/jsx-runtime";var C=({options:i,onChange:m,defaultValue:e,isOpen:x,onOpen:g,onClose:t})=>v(w,{isOpen:x,onClose:t,isLazy:!0,children:[r(h,{children:r(P,{fontWeight:"semibold",textAlign:"left",overflow:"hidden",w:"full",size:"sm",rightIcon:r(l,{}),variant:"outline",onClick:g,children:r(n,{textAlign:"left",w:"full",children:e==null?void 0:e.label})})}),r(b,{p:"0",minW:"40",w:"fit-content",maxH:"72",overflowY:"auto",children:r(B,{p:"0",children:i.map((o,c)=>v(s,{onClick:()=>{m(o),t()},bg:(o==null?void 0:o.value)===(e==null?void 0:e.value)?"muted":"initial",p:"1.5",cursor:"pointer",_hover:{bg:"muted"},children:[r(p,{children:o==null?void 0:o.icon}),r(n,{fontSize:"14px",ml:1,children:o.label})]},c))})})]}),z=C;export{z as default};
