PageSourceSearch

https://xbubble.ai/xbubble/assets/code-projects-DtA9F8E6.js

js xbubble.ai collected 2026-10-05 13:28:56 UTC 11,048 bytes, 11 lines download raw bytes

1import{c as C,d as Q,e as S,a as p,k as I,j as e,ax as M,B as j,w as g,aT as l}from"./index-CRPZpX17.js";import{M as R}from"./header-CqtDmtDa.js";import{d as W,o as G}from"./popover-5zndvtb5.js";import{F as U}from"./noPackages-DM38xhD5.js";import{u as H,g as E,i as B,C as O}from"./use-code-mode-projects-CMu2Dslp.js";import{n as b}from"./sb-loading-BS93ZLM4.js";import{S as q}from"./search-C82yR-Px.js";import{R as J}from"./refresh-ccw-DyyvFge7.js";import{T as L}from"./trash-2-3MeFaQb8.js";import"./mobile-pending-C6irSst_.js";import"./logo-B8_A0nH6.js";import"./device-status-icons-7iM_qVs6.js";/**
2 * @license lucide-react v0.372.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const T=C("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
7 * @license lucide-react v0.372.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const z=C("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]),X="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAB/1JREFUeAHtnU1sE0cUx9+s+bCdgBKqkoT24EUxIhVtQg8NqAec9lIOIHErPRWVS08h13IgHKBHzKmHFgGn9IZUDkWqStxDBUFqG0qloJrWRqJ1Eqk0AhM7SrzTeRscOeu1d9cOxeP3flJkZ7/G8vvPm5n3ZsYCGiT9NJcw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I9AFEMC1IC36QX5/5VQtBvs3umYSRAdk+k17SHgZawLgJDCmX41PNXgC3FYhIYUiyDPIuvtgDMbnNBSPYCVFDt/pWBSF8W369FAkNLS+McFGp/sO0v135kTQDoBcAonQWmrTFCYrxc++3/K0/Gw7uS3BS0L1LZtn9Lz9XKY8LtwnRhFjfISQDTPqiIbzzcW/UTJq7ZwE3FwjHVWHCAqH1I5bcWXLdYE/XuerD4d1IKYxQYbUG3vye661St83XnA/SrGyXIE9hzBEYvcEQnYaye8RHPCSF7In1XSiBHpCWvAqMFWOvzkUUzHu31DPAJCMBMIRcLWTAOhjikbowB0zpgjVch/Xy4mNwvTN/xnEACqCRdyCUsCxKhkDGovENMPSrGCaX/CWVsKSTO5pkWIFKWLN2NR/pS0AD/AXioLpY45A3CAAAAAElFTkSuQmCC";function K({onBack:t}={}){const a=b("codeProjects"),{createThread:i}=W(),{agentApi:r,session:c}=Q(),o=S(),[n,x]=p.useState("all"),[N,v]=p.useState(""),{data:d=[],isLoading:F,isFetching:P}
11=H({keyword:N,active:!0}),k=d.length===0&&(F||P),w=p.useMemo(()=>d.filter(s=>{const h=E(s.status);return!(n==="running"&&!B(s.status)||n==="paused"&&h!=="paused")}),[n,d]),A={all:d.length,running:d.filter(s=>B(s.status)).length,paused:d.filter(s=>E(s.status)==="paused").length},Y=I({mutationFn:s=>r.updateProject(s),onSuccess:()=>{o.invalidateQueries({queryKey:[O,c==null?void 0:c.address]})}}),u=(s,h)=>{Y.mutate({id:s,status:h})},y=s=>{u(s,4)},D=()=>{i.mutate("code")};return e.jsx("div",{className:"min-h-full bg-[#F8F8F7]",children:e.jsxs("div",{className:"mx-auto max-w-[900px] pb-5 sm:pb-8 lg:pb-8",children:[e.jsxs("div",{className:"sticky top-0 z-10 bg-[#f8f8f7] px-4 pt-5 sm:pt-8",children:[e.jsx("div",{className:"block mb-4 md:hidden",children:e.jsx(R,{onBack:t})}),e.jsx("h1",{className:"text-[20px] font-semibold leading-[28px] text-[#34322d] md:text-[24px] md:leading-[42px]",children:a("title")}),e.jsx("p",{className:"mt-2 text-xs leading-[18px] text-[#858481]",children:a("subtitle")})]}),e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4 xl:flex-row xl:items-center xl:gap-3",children:[e.jsxs("div",{className:"flex gap-2 overflow-x-auto pb-1 [scrollbar-width:none] xl:shrink-0 xl:overflow-visible xl:pb-0 [&::-webkit-scrollbar]:hidden",children:[e.jsx(f,{active:n==="all",label:a("filters.all"),count:A.all,onClick:()=>x("all")}),e.jsx(f,{active:n==="running",label:a("filters.running"),count:A.running,onClick:()=>x("running")}),e.jsx(f,{active:n==="paused",label:a("filters.paused"),count:A.paused,onClick:()=>x("paused")})]}),e.jsxs("div",{className:"flex min-w-[100px] flex-1 items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1 min-w-0",children:[e.jsx(q,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#858481]"}),e.jsx(M,{value:N,onChange:s=>v(s.target.value),placeholder:a("searchPlaceholder"),className:"h-10 rounded-[10px] border-[#E5E7EB] bg-white pl-9 text-sm text-[#34322D] shadow-none placeholder:text-[#B6B6B3] focus-visible:ring-[#2AAE67]"})]}),e.jsxs(j,{type:"button",className:"h-10 shrink-0 gap-2 rounded-[10px] bg-[#2AAE67] px-4 text-sm font-medium text-white hover:bg-[#249B5B]",onClick:D,children:[e.jsx(G,{className:"w-4 h-4"}),a("new")]})]})]}),k?e.jsx(Z,{}):w.length>0?e.jsx("div",{className:"grid gap-4 px-4 md:grid-cols-2",children:w.map(s=>e.jsx(_,{project:s,onPause:()=>u(s.id,2),onResume:()=>u(s.id,1),onRestart:()=>u(s.id,3),onDelete:()=>y(s.id)},s.id))}):e.jsx("div",{className:"px-4",children:e.jsx(V,{})})]})})}function Z(){return e.jsx("div",{className:"grid gap-4 px-4 md:grid-cols-2",children:Array.from({length:4}).map((t,a)=>e.jsxs("div",{className:"flex min-w-0 flex-col overflow-hidden rounded-[12px] border border-[#0000000F] bg-white p-4",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx(l,{className:"size-16 shrink-0 rounded-[10px] bg-[#ECEBE9]"}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-2 pt-1",children:[e.jsx(l,{className:"h-5 w-2/3 bg-[#ECEBE9]"}),e.jsx(l,{className:"h-3 w-full bg-[#ECEBE9]"}),e.jsx(l,{className:"h-3 w-4/5 bg-[#ECEBE9]"}),e.jsx(l,{className:"h-3 w-1/2 bg-[#ECEBE9]"})]})]}),e.jsx("div",{className:"mt-4",children:e.jsx(l,{className:"h-7 w-24 rounded-[8px] bg-[#ECEBE9]"})}),e.jsx("div",{className:"my-4 h-px bg-[#0000000F]"}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsx(l,{className:"h-10 rounded-[10px] bg-[#ECEBE9]"}),e.jsx(l,{className:"h-10 rounded-[10px] bg-[#ECEBE9]"}),e.jsx(l,{className:"h-10 rounded-[10px] bg-[#ECEBE9]"})]})]},a))})}function V(){const t=b("codeProjects");return e.jsx("div",{className:"flex min-h-[260px] items-center justify-center rounded-[12px] border border-[#E5E7EB] bg-white px-4 py-12",children:e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx(U,{className:"h-6 w-6 text-[#858481]"}),e.jsx("div",{className:"text-xs font-medium leading-[24px] text-[#858481]",children:t("emptyProjects")})]})})}function f({active:t,label:a,count:i,onClick:r}){return e.jsxs(j,{type:"button",variant:"ghost",className:g("h-12 shrink-0 gap-2 rounded-full border sm:px-5 px-4 text-xs sm:text-[16
11px] font-medium hover:text-current",t?"border-[#2AAE6726] bg-[#2AAE670A] text-[#29ad68] hover:bg-[#2AAE670A]":"border-[#E5E7EB] bg-white text-[#858481] hover:bg-[#F3F3F1]"),onClick:r,children:[a,e.jsx("span",{className:g("inline-flex h-7 min-w-7 items-center justify-center rounded-full px-2 text-xs sm:text-[14px] font-bold",t?"bg-[#29ad68] text-white":"bg-[#f7f7f7] text-[#858481]"),children:i})]})}function _({project:t,onPause:a,onResume:i,onRestart:r,onDelete:c}){const o=b("codeProjects"),n=E(t.status),x=n==="running";return e.jsxs("div",{className:"flex min-w-0 flex-col overflow-hidden rounded-[12px] border border-[#0000000F] bg-white p-4",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx($,{project:t}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h2",{className:"truncate text-[16px] font-bold text-[#34322d]",children:t.name}),e.jsx("p",{className:"mt-1 line-clamp-2 text-xs leading-[20px] text-[#858481]",children:t.desc}),e.jsx("a",{href:t.projectUrl,target:"_blank",rel:"noopener noreferrer",className:"mt-1 block truncate text-xs leading-[20px] text-[#007AFF]",children:t.projectUrl})]})]}),e.jsx("div",{className:"mt-4",children:e.jsx(ee,{status:n,label:o(`status.${n}`)})}),e.jsx("div",{className:"my-4 h-px bg-[#0000000F]"}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[x?e.jsx(m,{icon:e.jsx(T,{className:"w-4 h-4"}),label:o("pause"),onClick:a}):e.jsx(m,{icon:e.jsx(z,{className:"w-4 h-4"}),label:o("resume"),onClick:i,tone:"green"}),e.jsx(m,{icon:e.jsx(J,{className:"w-4 h-4"}),label:o("restart"),onClick:r,disabled:!0}),e.jsx(m,{icon:e.jsx(L,{className:"w-4 h-4"}),label:o("delete"),onClick:c,tone:"danger"})]})]})}function $({project:t}){const a=t.logoUrl||X;return e.jsx("img",{src:a,alt:"",className:"size-16 shrink-0 rounded-[10px] object-cover",referrerPolicy:"no-referrer"})}function ee({status:t,label:a}){return e.jsxs("span",{className:g("inline-flex h-7 items-center gap-1.5 rounded-[8px] px-2 text-xs font-medium",t==="running"?"bg-[#2AAE6714] text-[#2AAE67]":"bg-[#FF950014] text-[#FF9500]"),children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}),a]})}function m({icon:t,label:a,onClick:i,tone:r="neutral",disabled:c=!1}){return e.jsxs(j,{type:"button",variant:"outline",className:g("h-10 gap-1.5 rounded-[10px] disabled:cursor-not-allowed disabled:pointer-events-auto border-[#E5E7EB] bg-white px-2 text-sm font-medium hover:bg-[#F8F8F7] hover:text-current",r==="green"&&"text-[#2AAE67]",r==="danger"&&"text-[#F25A5A]",r==="neutral"&&"text-[#646362]"),onClick:i,disabled:c,children:[t,a]})}const me=K;export{me as component};

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.