import{r as o,j as e}from"./vendor-react-wBh_31cN.js";import{C as h,a as u,b as x,c as f}from"./card-DISTA6Ay.js";import{aq as g,G as C,g as j,r as N}from"./index-BKr2rJhV.js";import{S as R}from"./search-input-Cdh3g8rj.js";import{u as b}from"./useTitle-DQo_L6Ox.js";import{t as v}from"./titles-CzjGGAB3.js";import{N as w}from"./NoData-jkjqmCYT.js";import{a as L,u as y}from"./index-DIGQ-MZU.js";import{R as E}from"./RoleChainingTable-gr9BUBFB.js";import{E as S}from"./Error404-B4n3go6x.js";import{u as A}from"./vendor-router-D1GqFWiT.js";import"./vendor-redux-CJZrIb6x.js";import"./vendor-utils-OeoE2qq_.js";import"./vendor-icons-BUUmD6ht.js";import"./vendor-radix-BRyWS4bQ.js";import"./vendor-grid-CeFlDWv4.js";import"./input-group-Z3Qmt3PL.js";import"./input-H6_qmzms.js";import"./label-Dnebucx5.js";import"./textarea-Co48BFy3.js";import"./table-CQMBoaty.js";import"./icon-button-FETOk6q1.js";import"./combobox-CcK1PxyF.js";import"./vendor-recharts-DmJlpLaF.js";import"./tooltip-Da8-EbK8.js";import"./confirmation-dialog-DFt7ZgUQ.js";import"./useCopyToClipboard-3DFwhniW.js";import"./useNotifier-BCEAoFCf.js";import"./notifications-x-pTFTQl.js";import"./toast-3g7Fh-a0.js";import"./useProjectOptions-C17r5Psb.js";import"./project-eQY1xQe-.js";import"./index-DQr7YlUK.js";import"./Error-ehOSFm_s.js";import"./useLastProject-CDGr1y3w.js";import"./useSortedProjects-B0vFqd_s.js";import"./index-BeaoFlb1.js";import"./apply-BmJxqxKH.js";import"./concat-AxOj0lUI.js";import"./sortBy-DS9fyPwj.js";import"./juxt-BvCFisbd.js";import"./converge-BDz-h6lA.js";import"./includes-D04d5Ytc.js";const je=()=>{b(v.iamRole);const l=A(),[i,n]=o.useState(""),{data:t=[],isLoading:a}=L(),{data:s,isLoading:p}=y(),[c,m]=o.useState([]);o.useEffect(()=>{!a&&t.length>0&&m(i?t.filter(r=>r.projectName.toLowerCase().includes(i)||r.cloudRole.toLowerCase().includes(i)):t)},[a,t,i]);const d=o.useCallback(({target:r})=>{n(r.value)},[n]);return a||p?e.jsx(g,{}):s!=null&&s.enabled?e.jsxs(h,{children:[e.jsxs(u,{className:"flex flex-row items-center justify-between",children:[e.jsx(x,{children:"IAM Role Chaining"}),e.jsx(C,{onClick:()=>{l(j(N.settings.iamRoleChaining.create))},children:"New role chaining"})]}),e.jsxs(f,{className:"max-h-[calc(100vh-215px)] overflow-auto",children:[e.jsxs("div",{className:"mb-7 flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-bold text-quartz-primary",children:t.length}),e.jsx("span",{className:"text-xs font-bold",children:"role chaining"})]}),t&&t.length>0?e.jsxs(e.Fragment,{children:[e.jsx(R,{className:"mt-2.5 w-[294px]",value:i,placeholder:"Find a chaining by project name, cloud role...",onChange:d}),e.jsx(E,{roleChaining:c,isEditable:!0})]}):e.jsx("div",{className:"my-10",children:e.jsx(w,{mainText:"No IAM Role Chaining found"})})]})]}):e.jsx(S,{})};export{je as default};
