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-BeQtvmcJ.js";import{aq as g,G as C,g as j,r as N}from"./index-dNe6i2rS.js";import{S as R}from"./search-input-BWz7f2O1.js";import{u as b}from"./useTitle-DQo_L6Ox.js";import{t as v}from"./titles-CzjGGAB3.js";import{N as w}from"./NoData-BtM2pAIA.js";import{a as L,u as y}from"./index-Cs_VUG1d.js";import{R as E}from"./RoleChainingTable-TppHGVrY.js";import{E as S}from"./Error404-DQ9qHPOM.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-gxy3DSmS.js";import"./input-DFI7JniT.js";import"./label-gPWmc6ow.js";import"./textarea-BJVuSob1.js";import"./table-a0YeQrHM.js";import"./icon-button-BZeFL7T7.js";import"./combobox-QqI9aNup.js";import"./vendor-recharts-DmJlpLaF.js";import"./tooltip-DFFgUYh6.js";import"./confirmation-dialog-C7dws5K4.js";import"./useCopyToClipboard-DfzwgDFE.js";import"./useNotifier-BGMn6HaH.js";import"./notifications-5miqOdlG.js";import"./toast-wiGcevcF.js";import"./useProjectOptions-DNIvu1Mu.js";import"./project-eQY1xQe-.js";import"./index-DIs5Kizm.js";import"./Error-Cui9k53k.js";import"./useLastProject-Du1ajmeV.js";import"./useSortedProjects-DPrT0V3d.js";import"./index-DURBtSjL.js";import"./apply-CIuXDHQi.js";import"./concat-CTXo1gGM.js";import"./sortBy-COer1Ia5.js";import"./juxt-B5kKHsyp.js";import"./converge-D7u3m7i4.js";import"./includes-ucXR_9jq.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};
