import{c as h,j as e,r as d}from"./index-B3TsnAiv.js";import{C as m}from"./chat-header-KHbMuBui.js";import{c as x,g as c,L as p}from"./sidebar-toggle-D8wRPeaZ.js";/**
 * @license lucide-react v0.479.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const f=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],g=x("Bot",f);function v({agent:s,agentIdx:t,agents:r}){const[n,o]=d.useState(!1),[a,u]=d.useState(!1),l=d.useRef(null);return d.useEffect(()=>{if(l.current&&s.description){const i=l.current;u(i.scrollHeight>i.clientHeight)}},[s.description]),e.jsxs("div",{className:c(t===0?"rounded-tl-lg rounded-tr-lg sm:rounded-tr-none":"",t===1?"sm:rounded-tr-lg":"",t===r.length-2?"sm:rounded-bl-lg":"",t===r.length-1?"rounded-bl-lg rounded-br-lg sm:rounded-bl-none":"","group relative bg-muted/40 p-6 focus-within:ring-2 focus-within:ring-inset focus-within:ring-ring"),children:[e.jsx("div",{children:e.jsx("span",{className:c("inline-flex rounded-lg p-3 ring-4 ring-secondary"),children:e.jsx(g,{"aria-hidden":"true",className:"size-6"})})}),e.jsxs("div",{className:"mt-8",children:[e.jsx("h3",{className:"text-base font-semibold",children:e.jsxs(p,{to:"/agent/$agentId",params:{agentId:s.id},className:"focus:outline-none",children:[e.jsx("span",{"aria-hidden":"true",className:"absolute inset-0"}),s.name]})}),s.description&&e.jsxs("div",{className:"mt-2",children:[e.jsx("p",{ref:l,className:c("text-sm text-muted-foreground",!n&&"line-clamp-2"),children:s.description}),a&&e.jsx("button",{onClick:i=>{i.preventDefault(),i.stopPropagation(),o(!n)},className:"relative z-10 mt-1 text-xs text-primary hover:text-primary/80 focus:outline-none rounded pointer-events-auto",children:n?"Show less":"Show more"})]})]}),e.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute right-6 top-6 text-muted-foreground/20 group-hover:text-muted-foreground/40",children:e.jsxs("svg",{fill:"currentColor",viewBox:"0 0 24 24",className:"size-6",children:[e.jsx("title",{children:"Open"}),e.jsx("path",{d:"M20 4h1a1 1 0 00-1-1v1zm-1 12a1 1 0 102 0h-2zM8 3a1 1 0 000 2V3zM3.293 19.293a1 1 0 101.414 1.414l-1.414-1.414zM19 4v12h2V4h-2zm1-1H8v2h12V3zm-.707.293l-16 16 1.414 1.414 16-16-1.414-1.414z"})]})})]})}const b=function(){var n;const{agents:t}=h.useLoaderData(),r=((n=t.data)==null?void 0:n.data)||[];return e.jsxs("div",{className:"flex flex-col flex-1",children:[e.jsx(m,{}),e.jsx("div",{className:"flex flex-1 flex-col gap-4 p-4 justify-center",children:e.jsx("div",{className:"divide-y divide-border overflow-hidden rounded-lg shadow sm:grid sm:grid-cols-2 sm:gap-1 sm:divide-y-0",children:r.map((o,a)=>e.jsx(v,{agent:o,agentIdx:a,agents:r},o.id))})})]})};export{b as component};
