PageSourceSearch

https://xterns.ai/assets/ClientProjects-C60_XiOH.js

js xterns.ai collected 2026-10-05 13:24:27 UTC 6,211 bytes, 1 lines download raw bytes

1import{j as e,u as E,r,bI as L,B as N,I as M,h as _,i as B,k as O,J as l,m as R,X as T,ae as V,ad as q}from"./index-DLd_kDlx.js";import{C as F}from"./ClientBusinessGate-CKL9R3zX.js";import{q as I}from"./businessManagement-BTTXtuIj.js";import{W as U}from"./WizardMockContainer-Dn7sEr7R.js";import{P as D}from"./ProjectDetailsModal-inVluIgr.js";import{P as G}from"./PodCreationWizard-CdgIUX8C.js";import{u as H}from"./useClientPodCreation-BdAaEieM.js";import{P as J}from"./plus-0WhrdjYO.js";import{S as K}from"./search-DFH5eAlA.js";import{L as X}from"./loader-circle-D2miE2xB.js";import{E as Y}from"./eye-CRDofLPH.js";import"./timer-CZhDpZys.js";import"./briefcase-business-CphIeAJd.js";import"./select-RSrodAEw.js";import"./index-BdQq_4o_.js";import"./index-Deh-4PO1.js";import"./chevron-down-DpJJsCer.js";import"./chevron-up-M4SAwIjf.js";import"./scroll-area-BXTuUF24.js";import"./alert-CyfKy7ls.js";import"./info-BLiu1f4f.js";import"./lightbulb-BpXO0eKD.js";import"./radio-group-BU56MLP7.js";import"./index-lTaZyIGy.js";import"./route-Rd_Np_3d.js";import"./triangle-alert-Chqk_WK7.js";import"./textarea-C6X-I43k.js";import"./refresh-cw-CoPjtj5-.js";import"./save-DnzFMk1L.js";import"./trash-2-0uuZSTFd.js";import"./code-xml-BUecDWl6.js";import"./shield-alert-CVqPbwtZ.js";import"./book-open-BSYsXyfC.js";import"./git-branch-C-twpC7K.js";import"./label-D4-ENrYn.js";import"./globe-C057RQ73.js";import"./PodNameGenerator-DUSAq0St.js";import"./table-BOJIo-OD.js";import"./useTechLeads-Cmw-XrPs.js";import"./mail-plus-CkuPXPSq.js";import"./star-BH1OFEcs.js";import"./external-link-D0CFvOTk.js";import"./useAIDeliveryPlanning-CTW9zPaD.js";const Ie=()=>e.jsx(F,{children:({business:a})=>e.jsx(A,{businessId:a.id})}),$=a=>{var n;return((n=q.find(i=>i.id===a))==null?void 0:n.name)||a},A=({businessId:a})=>{const n=E(),[i,v]=r.useState([]),[m,C]=r.useState(""),[w,c]=r.useState(!1),[P,u]=r.useState(!0),[f,p]=r.useState(null),[b,x]=r.useState(null),[y,h]=r.useState(!1),{createPod:S}=H(a),g=async()=>{u(!0);try{v(await I(a))}catch(s){V({title:"Unable to load projects",description:s instanceof Error?s.message:"Please try again.",variant:"destructive"})}finally{u(!1)}};r.useEffect(()=>{g()},[a]);const j=r.useMemo(()=>{const s=m.trim().toLowerCase();return s?i.filter(t=>[t.title,t.description,t.project_goal].some(d=>d.toLowerCase().includes(s))):i},[i,m]),z=()=>{c(!1),g()},W=s=>{p(null),x(s),h(!0)},k=async s=>{const t=await S(s);h(!1),x(null),n(`/client/pods/${t.id}/setup`)};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{className:"h-6 w-6 text-primary"}),e.jsx("h1",{className:"text-2xl font-bold",children:"Projects"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"View reusable project templates and create projects for your business."})]}),e.jsxs(N,{className:"gap-2",onClick:()=>c(!0),children:[e.jsx(J,{className:"h-4 w-4"}),"Create Project"]})]}),e.jsxs("div",{className:"relative max-w-md",children:[e.jsx(K,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(M,{value:m,onChange:s=>C(s.target.value),placeholder:"Search projects...",className:"pl-9"})]}),P?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx(X,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):j.length===0?e.jsx("p",{className:"rounded-lg border bg-white py-12 text-center text-muted-foreground",children:"No projects found."}):e.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:j.map(s=>{const t=s.career_paths??[],d=t.length>1;return e.jsxs(_,{className:"flex flex-col",children:[e.jsxs(B,{children:[e.jsx(O,{className:"text-lg",children:s.title}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.is_business_owned?e.jsx(l,{className:"bg-blue-100 text-blue-800 hover:bg-blue-100",children:"Your business"}):e.jsx(l,{variant:"outline",children:"Reusable template"}),e.jsx(l,{variant:"outline",className:"capitalize",children:s.difficulty_level}),e.jsx(l,{className:"bg-emerald-100 text-emerald-800 hover:bg-emerald-100",children:s.status}),t.length>0&&e.jsx(l,{className:d?"bg-indigo-100 text-indigo-800 hover:bg-indigo-100":"bg-slate-100 text-slate-800 hover:bg-slate-100",children:d?"Multilateral":"Unilateral"})]})]}),e.jsxs(R,{className:"flex flex-1 flex-col gap-4",children:[e.jsx("p",{className:"line-clamp-3 text-sm text-muted-foreground",children:s.description}),t.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Pathways"}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[t.slice(0,4).map(o=>e.jsx(l,{variant:"secondary",className:"bg-purple-50 text-purple-700 hover:bg-purple-50",children:$(o)},o)),t.length>4&&e.jsxs(l,{variant:"secondary",children:["+",t.length-4]})]})]}),s.technologies.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1",children:[s.technologies.slice(0,5).map(o=>e.jsx(l,{variant:"secondary",children:o},o)),s.technologies.length>5&&e.jsxs(l,{variant:"secondary",children:["+",s.technologies.length-5]})]}),e.jsx("div",{className:"mt-auto pt-2",children:e.jsxs(N,{variant:"outline",size:"sm",className:"w-full gap-2",onClick:()=>p(s),children:[e.jsx(Y,{className:"h-4 w-4"}),"View Project Template"]})})]})]},s.id)})}),w&&e.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto bg-black/50",children:e.jsx("div",{className:"relative min-h-screen p-4",children:e.jsxs("div",{className:"mx-auto w-full max-w-6xl",children:[e.jsx("button",{onClick:()=>c(!1),className:"fixed right-6 top-6 z-[60] rounded-full bg-white p-2 shadow-lg transition-colors hover:bg-gray-100","aria-label":"Close wizard",children:e.jsx(T,{className:"h-5 w-5"})}),e.jsx(U,{businessId:a,onCancel:()=>c(!1),onProjectCreated:z})]})})}),e.jsx(D,{project:f,isOpen:!!f,onClose:()=>p(null),userType:"techlead",onCreatePod:s=>W(s)}),e.jsx(G,{project:b,isOpen:y,onClose:()=>{h(!1),x(null)}
1,onCreatePod:k,creatorContext:"client",oauthReturnPath:"/client/projects"})]})};export{Ie as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.