import{J as n,r as s,j as r,Q as c,S as h}from"./app-BBZbvTSO.js";import{A as u}from"./app-layout-DgXit_SB.js";import{B as f}from"./button-CZmOQP7j.js";import{C as x,a as b,b as j,d as C}from"./card-LUGiYPFK.js";import{S as v}from"./search-bar-FrEZMnbC.js";import g from"./CreateProjectModal-CvC6x5bI.js";import{P as w}from"./plus-D8fMMvfS.js";/* empty css            */import"./utils-YhN_nlHn.js";import"./index-C0VDnRYN.js";import"./index-CbDI-tXU.js";import"./Combination-9YgcTppv.js";import"./index-13DH8-b5.js";import"./index-C1VwruLz.js";import"./tooltip-CRkL5R4V.js";import"./index-hDbW6ayQ.js";import"./floating-ui.dom-DtF1XweH.js";import"./index-AiAmtg3H.js";import"./dropdown-menu-DkvU_mzU.js";import"./index-IvSACaye.js";import"./index-BosTFUDi.js";import"./index-Dbn6AP0q.js";import"./settings-1sj5BLwD.js";import"./app-logo-icon-BZsH9yGo.js";import"./index-BnKWxTXF.js";import"./image-BEhzBCM8.js";import"./globe-DRyUQWUz.js";import"./users-DU0sA3Q7.js";import"./layout-grid-CF44vN4j.js";import"./chevron-right-fDICdnKB.js";import"./input-dmj4QjAp.js";import"./checkbox-B0_9jnY6.js";import"./index-BCYyBCUm.js";import"./check-yuW7wFtQ.js";import"./dialog-D_v2qgP5.js";import"./label-BPDCCRHl.js";import"./textarea-DorjplNc.js";import"./Select-BSWSW26d.js";import"./radio-group-Ba_2z_o7.js";import"./input-error-Bz7f2c6i.js";import"./locales-b3RnhGsA.js";const S=[{title:"Dashboard",href:"/"}];function nr({projects:a}){const d=n().props.userCan,[p,t]=s.useState(!1),[o,m]=s.useState(""),l=a.filter(e=>{var i;return e.name.toLowerCase().includes(o.toLowerCase())||(((i=e.description)==null?void 0:i.toLowerCase().includes(o.toLowerCase()))??!1)});return r.jsxs(u,{breadcrumbs:S,children:[r.jsx(c,{title:"Dashboard"}),r.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl",children:[r.jsx(v,{value:o,onChange:m,placeholder:"Search projects..."}),r.jsxs("div",{className:"grid auto-rows-min gap-4 sm:grid-cols-2 md:grid-cols-3  lg:grid-cols-5",children:[d.create_project&&r.jsxs(f,{variant:"ghost",className:"h-full w-full flex flex-col items-center justify-center gap-2 border-sidebar-border/70 dark:border-sidebar-border relative aspect-video overflow-hidden rounded-xl border cursor-pointer",onClick:()=>t(!0),children:[r.jsx(w,{className:"h-8 w-8"}),r.jsx("span",{children:"Create Project"})]}),l.map(e=>r.jsx(x,{className:"border-sidebar-border/70 dark:border-sidebar-border relative aspect-video overflow-hidden rounded-xl border cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>h.visit(route("projects.show",e.id)),children:r.jsxs(b,{children:[r.jsx(j,{children:e.name}),r.jsx(C,{children:e.description||"No description"})]})},e.id))]})]}),r.jsx(g,{open:p,onOpenChange:t})]})}export{nr as default};
