import{u as L,c as m,i as t,b as _,A as g,e as p,g as b,m as P,t as o,f as A}from"./main-B-KzsHRi.js";import{c as D}from"./service-DriRc7_Z.js";var N=o('<div class=freno-project-list><div class=freno-page-header><h1>Projects</h1></div><div class=freno-toolbar><div class=freno-search-box><input type=text placeholder="Search projects..."class=freno-input></div><div class=freno-filter-tabs></div></div><div class=freno-project-grid>'),U=o("<button>"),k=o("<div class=freno-empty-state><div class=freno-empty-icon>📁</div><h3>No projects found</h3><p>"),E=o("<div class=freno-project-card-header><h3></h3><span>"),q=o("<p class=freno-project-card-desc>"),F=o("<div class=freno-project-card-footer><span class=freno-collab-count> collaborator</span><span class=freno-date>Updated ");const z=()=>{L();const C=D(),[d,S]=m(""),[f,j]=m("all"),u=()=>{let r=C.projects();if(f()!=="all"&&(r=r.filter(s=>s.status===f())),d()){const s=d().toLowerCase();r=r.filter(c=>c.name.toLowerCase().includes(s)||c.description.toLowerCase().includes(s))}return r},x=r=>new Date(r).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return(()=>{var r=N(),s=r.firstChild;s.firstChild;var c=s.nextSibling,h=c.firstChild,$=h.firstChild,y=h.nextSibling,w=c.nextSibling;return t(s,_(g,{href:"/projects/new",class:"freno-btn freno-btn-primary",children:"+ New Project"}),null),$.$$input=n=>S(n.target.value),t(y,()=>["all","active","draft","archived"].map(n=>(()=>{var e=U();return e.$$click=()=>j(n),t(e,()=>n.charAt(0).toUpperCase()+n.slice(1)),p(()=>b(e,`freno-tab ${f()===n?"freno-tab-active":""}`)),e})())),t(w,(()=>{var n=P(()=>u().length===0);return()=>n()?(()=>{var e=k(),a=e.firstChild,l=a.nextSibling,i=l.nextSibling;return t(i,()=>d()||f()!=="all"?"Try adjusting your search or filters.":"Create your first project to get started."),e})():u().map(e=>_(g,{get href(){return`/projects/${e.id}`},class:"freno-project-card",get children(){return[(()=>{var a=E(),l=a.firstChild,i=l.nextSibling;return t(l,()=>e.name),t(i,()=>e.status),p(()=>b(i,`freno-badge freno-badge-${e.status}`)),a})(),(()=>{var a=q();return t(a,()=>e.description),a})(),(()=>{var a=F(),l=a.firstChild,i=l.firstChild,v=l.nextSibling;return v.firstChild,t(l,()=>e.collaborators.length,i),t(l,()=>e.collaborators.length!==1?"s":"",null),t(v,()=>x(e.updatedAt),null),a})()]}}))})()),p(()=>$.value=d()),r})()};A(["input","click"]);export{z as ProjectList};
//# sourceMappingURL=ProjectList-ByXstiby.js.map
