import{r as e,t}from"./jsx-runtime-DAs1UGHr.js";import"./react-DxF41JXl.js";import"./use-runtime-config-D_-Z8FUB.js";import"./use-api-BAbm8GVs.js";import{t as n}from"./page-container-DV9_twon.js";import"./entity-service-D6-I4F0h.js";import{t as r}from"./use-all-experiments-2M5Vv300.js";import{i,n as a,r as o,t as s}from"./search-input-DVDKmJAY.js";import{t as c}from"./row-action-button-CWxfWRow.js";var l=e(t(),1);function u(){let{searchTerm:e,submittedTerm:t,handleInputChange:u,handleSearchSubmit:d,handleClearSearch:f}=i(),{isLoading:p,error:m,refresh:h,allExperiments:g}=r(),_=(g||[]).filter(e=>e.name.toLowerCase().includes(t.toLowerCase())),v=e=>(0,l.jsx)(`div`,{className:`invisible group-hover:visible`,children:(0,l.jsx)(c,{entityId:e.id,route:`/experiments`,buttonText:`Manage permissions`})});return(0,l.jsxs)(n,{title:`Experiments`,children:[(0,l.jsx)(a,{isLoading:p,loadingText:`Loading experiments list...`,error:m,onRetry:h}),!p&&!m&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`div`,{className:`mb-2`,children:(0,l.jsx)(s,{value:e,onInputChange:u,onSubmit:d,onClear:f,placeholder:`Search experiments...`})}),(0,l.jsx)(o,{mode:`object`,data:_,columns:[{header:`Experiment Name`,render:e=>e.name},{header:`Permissions`,render:e=>v(e),className:`flex-shrink-0`}],searchTerm:t})]})]})}export{u as default};