PageSourceSearch

https://ddq.analystai.ai/assets/HamiltonWorkspaceLab-Cq57GVTv.js

js analystai.ai collected 2026-10-05 11:49:06 UTC 5,413 bytes, 1 lines download raw bytes

1import{j as e}from"./ui-DIPIJzva.js";import{e as g,r as a,L as n}from"./router-Byi7yoBN.js";import{p as j,B as f,f as N,a as v,y,I as L}from"./index-SYZ0ryS_.js";import{S as P,P as S}from"./ProjectWorkspacePilot-DKJ-V4B5.js";import{E as b}from"./external-link-CojsOPty.js";import"./react-vendor-Bq7xPAhO.js";import"./refresh-cw-Dk5xtiLW.js";import"./bot-CZWEbQ5y.js";import"./wrench-BJuV4Jpy.js";import"./ellipsis-MBbCaUNA.js";import"./send-BzwR36RB.js";import"./download-D45kurOr.js";function Q(){const{projectId:s}=g(),[o,d]=a.useState(null),[i,k]=a.useState([]),[c,w]=a.useState(""),[m,x]=a.useState(""),[h,p]=a.useState(!0);a.useEffect(()=>{let t=!1;return p(!0),x(""),d(null),(s?j.getProject(s).then(r=>{t||d(r)}):j.listProjects(0,100).then(r=>{t||k(r.projects||[])})).catch(r=>{t||x(r instanceof Error?r.message:"Could not load workspace projects.")}).finally(()=>{t||p(!1)}),()=>{t=!0}},[s]),a.useEffect(()=>{o?.title&&(document.title=`${o.title} · Hamilton Workspace Lab`)},[o?.title]);const u=a.useMemo(()=>{const t=c.trim().toLowerCase();return t?i.filter(l=>[l.title,l.sector,l.country,l.status].filter(Boolean).join(" ").toLowerCase().includes(t)):i},[i,c]);return e.jsxs("div",{className:"flex h-screen min-h-0 flex-col overflow-hidden bg-slate-50 text-slate-950 dark:bg-black dark:text-white",children:[e.jsxs("header",{className:"flex h-12 shrink-0 items-center justify-between border-b border-slate-200 bg-white px-3 dark:border-white/10 dark:bg-slate-950",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(f,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 w-8 shrink-0 p-0",title:s?"Back to project":"Back to projects",children:e.jsx(n,{to:s?`/projects/${s}?tab=workspace`:"/projects",children:e.jsx(N,{className:"h-4 w-4"})})}),e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(P,{className:"h-4 w-4 shrink-0 text-blue-600 dark:text-blue-300"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"truncate text-sm font-semibold tracking-normal",children:"Hamilton Workspace Lab"}),e.jsx("p",{className:"truncate text-xs text-slate-500 dark:text-slate-400",children:h?"Loading":o?.title||"Choose a project"})]})]})]}),s?e.jsx(f,{asChild:!0,variant:"outline",size:"sm",className:"h-8 shrink-0 gap-2 bg-white dark:bg-slate-950",children:e.jsxs(n,{to:`/projects/${s}?tab=workspace`,children:[e.jsx(b,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Project view"})]})}):null]}),e.jsx("main",{className:"min-h-0 flex-1 overflow-hidden",children:h?e.jsxs("div",{className:"flex h-full items-center justify-center text-sm text-slate-500 dark:text-slate-400",children:[e.jsx(v,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading workspace"]}):m?e.jsx("div",{className:"mx-auto mt-12 max-w-md rounded-md border border-red-200 bg-red-50 p-4 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-200",children:m}):s?e.jsx(S,{projectId:s}):e.jsx("div",{className:"h-full overflow-auto px-4 py-5",children:e.jsxs("div",{className:"mx-auto flex max-w-5xl flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"text-lg font-semibold tracking-normal",children:"Open a Hamilton workspace"}),e.jsx("p",{className:"mt-1 max-w-2xl text-sm leading-5 text-slate-500 dark:text-slate-400",children:"Select a project to enter the standalone sandbox surface."})]}),e.jsxs("div",{className:"relative w-full sm:w-80",children:[e.jsx(y,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400"}),e.jsx(L,{value:c,onChange:t=>w(t.target.value),placeholder:"Search projects",className:"h-9 pl-9"})]})]}),u.length>0?e.jsx("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-2",children:u.map(t=>e.jsxs(n,{to:`/hamilton-workspace/${t.id}`,className:"group flex min-h-[92px] min-w-0 flex-col justify-between rounded-md border border-slate-200 bg-white p-3 shadow-sm transition hover:border-blue-300 hover:bg-blue-50/60 dark:border-white/10 dark:bg-slate-950 dar
1k:hover:border-blue-800 dark:hover:bg-blue-950/20",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("h3",{className:"truncate text-sm font-semibold text-slate-950 dark:text-white",children:t.title}),e.jsx("span",{className:"shrink-0 rounded-sm bg-slate-100 px-1.5 py-0.5 text-[11px] capitalize text-slate-500 dark:bg-slate-800 dark:text-slate-300",children:t.status})]}),e.jsx("p",{className:"mt-1 line-clamp-2 text-xs leading-5 text-slate-500 dark:text-slate-400",children:[t.sector,t.country].filter(Boolean).join(" · ")||"Project workspace"})]}),e.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs text-slate-500 dark:text-slate-400",children:[e.jsxs("span",{children:[t.document_count||0," documents"]}),e.jsxs("span",{className:"flex items-center gap-1 text-blue-600 opacity-0 transition group-hover:opacity-100 dark:text-blue-300",children:["Open",e.jsx(b,{className:"h-3.5 w-3.5"})]})]})]},t.id))}):e.jsx("div",{className:"rounded-md border border-dashed border-slate-300 bg-white p-8 text-center text-sm text-slate-500 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-400",children:"No matching projects."})]})})})]})}export{Q 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.