import{o as e,r as t}from"./button-DJ30HgDO.js";import"./use-runtime-config-CkwqDzno.js";import"./use-api-CtLXpHJw.js";import{i as n,n as r,r as i,t as a}from"./page-status-CNIWXN7q.js";import{t as o}from"./page-container-DN56Bi3o.js";import{t as s}from"./row-action-button-m2Rwnof1.js";import"./entity-service-KdPsD3WQ.js";import{t as c}from"./use-all-prompts-DI2n7rek.js";var l=e(t(),1);function u(){let{searchTerm:e,submittedTerm:t,handleInputChange:u,handleSearchSubmit:d,handleClearSearch:f}=n(),{isLoading:p,error:m,refresh:h,allPrompts:g}=c(),_=(g||[]).filter(e=>e.name.toLowerCase().includes(t.toLowerCase())),v=e=>(0,l.jsx)(`div`,{className:`invisible group-hover:visible`,children:(0,l.jsx)(s,{entityId:e.name,route:`/prompts`,buttonText:`Manage permissions`})});return(0,l.jsxs)(o,{title:`Prompts`,children:[(0,l.jsx)(a,{isLoading:p,loadingText:`Loading prompts list...`,error:m,onRetry:h}),!p&&!m&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`div`,{className:`mb-2`,children:(0,l.jsx)(i,{value:e,onInputChange:u,onSubmit:d,onClear:f,placeholder:`Search prompts...`})}),(0,l.jsx)(r,{data:_,columns:[{header:`Name`,render:e=>e.name},{header:`Permissions`,render:e=>v(e),className:`flex-shrink-0`}],searchTerm:t})]})]})}export{u as default};