import{j as o,f as m,P}from"./antd.c323f587.js";import{r as i}from"./react.dcf569d1.js";import{u as y}from"./Roles.b29dacff.js";import{d as h,u as d,s as p}from"./index.5fa92bd5.js";import{s as v}from"./index.a5de5d12.js";function j({item:r}){var u;const[f,a]=i.exports.useState(!1),{user:s}=h(),t=y(),c=i.exports.useMemo(()=>((s==null?void 0:s.roles)||[]).map(e=>t.find(l=>l.key===e)).filter(e=>e!==void 0).map(e=>({label:e.name,value:String(e.id)})),[s==null?void 0:s.roles,t]),n=r.roleKey||"roleId",{[n]:b}=d();return o(m,{className:v.rolePicker,style:(u=r.styles)==null?void 0:u.default,children:o(m.Item,{label:r.label||"\u5F53\u524D\u89D2\u8272",onClick:()=>{a(!0)},children:o(P,{visible:f,columns:[c],value:[String(b)],onClose:()=>a(!1),onConfirm:e=>{!(e!=null&&e[0])||p({[n]:Number(e[0])})},children:e=>{var l;return o("span",{children:((l=e==null?void 0:e[0])==null?void 0:l.label)||r.placeholder||"\u672A\u9009\u62E9"})}})})})}export{j as default};
