PageSourceSearch

https://growthpad.org/assets/WorkspaceLayout-e4tbDa4Y.js

js growthpad.org collected 2026-10-05 08:55:00 UTC 8,701 bytes, 21 lines download raw bytes

1import{Y as p,_ as U,r as d,j as e,bL as _,bM as H,B as b,bN as I,bO as B,bP as y,bQ as j,aJ as G,af as O,bH as T,$ as A,a0 as z,a1 as E,a2 as R,aK as J,L as C,I as S,J as $,bR as q,bk as M,bS as K,bT as V,bU as Y,bV as Q,bW as X,bX as Z,bY as ee,bZ as se,b_ as ae,b$ as te,c0 as re,c1 as ne,F as ie,g as le,U as oe,K as ce,be as de,c2 as pe,aP as me,aF as xe,bi as g,H as he,c3 as L,c4 as ue,c5 as be}from"./index-fzCG7T_H.js";import{u as f,W as je}from"./useWorkspaces-BqRUj6MI.js";import{W as ge}from"./wrench-Lh6xZekc.js";import{P as fe}from"./plug-D8ZL0xNG.js";/**
2 * @license lucide-react v0.462.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 ke=p("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
7 * @license lucide-react v0.462.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 we=p("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
12 * @license lucide-react v0.462.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const Ne=p("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
17 * @license lucide-react v0.462.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const ve=p("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]),W=n=>n.split(" ").map(a=>a[0]).join("").toUpperCase().slice(0,2),ye=({collapsed:n})=>{const{memberships:a,current:s,switchWorkspace:i,createWorkspace:m,plan:l,atWorkspaceLimit:t,loading:x}=f(),h=U(),[D,o]=d.useState(!1),[c,k]=d.useState(""),[w,N]=d.useState(""),[u,v]=d.useState(!1),P=async r=>{if(r.preventDefault(),!c.trim())return;v(!0);const F=await m(c.trim(),w.trim()||void 0);v(!1),F&&(o(!1),k(""),N(""),$.success("Workspace created"),h("/app/onboarding"))};return x?e.jsx("div",{className:"mx-2 h-12 animate-pulse rounded-md bg-muted"}):e.jsxs(e.Fragment,{children:[e.jsxs(_,{children:[e.jsx(H,{asChild:!0,children:e.jsx(b,{variant:"ghost",className:"h-auto w-full justify-start px-2 py-2",children:e.jsxs("div",{className:"flex w-full items-center gap-3",children:[e.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary",children:s!=null&&s.logo_url?e.jsx("img",{src:s.logo_url,alt:"",className:"h-8 w-8 rounded-md object-cover"}):e.jsx("span",{className:"text-xs font-semibold",children:W((s==null?void 0:s.name)??"GP")})}),!n&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"min-w-0 flex-1 text-left",children:[e.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:(s==null?void 0:s.name)??"No workspace"}),e.jsxs("div",{className:"truncate text-xs text-muted-foreground",children:[l.name," plan"]})]}),e.jsx(ke,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]})]})})}),e.jsxs(I,{align:"start",className:"w-64",children:[e.jsx(B,{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Workspaces"}),e.jsx(y,{}),a.map(r=>e.jsxs(j,{onClick:()=>i(r.workspace_id),className:"flex items-center gap-3 py-2",children:[e.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded bg-primary/10 text-[10px] font-semibold text-primary",children:W(r.workspace.name)}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-sm",children:r.workspace.name}),e.jsx("div",{className:"text-xs capitalize text-muted-foreground",children:r.role})]}),(s==null?void 0:s.id)===r.workspace_id&&e.jsx(G,{className:"h-4 w-4 text-primary"})]},r.id)),e.jsx(y,{}),e.jsxs(j,{onClick:()=>t?h("/app/billing"):o(!0),children:[t?e.jsx(O,{className:"mr-2 h-4 w-4"}):e.jsx(T,{className:"mr-2 h-4 w-4"}
21),t?`Upgrade for more than ${l.workspaceLimit}`:"Create workspace"]}),e.jsx(j,{onClick:()=>h("/app/settings"),children:"Workspace settings"})]})]}),e.jsx(A,{open:D,onOpenChange:o,children:e.jsxs(z,{className:"sm:max-w-md",children:[e.jsxs(E,{children:[e.jsx(R,{className:"font-heading",children:"Create a workspace"}),e.jsx(J,{children:"A workspace holds one company or product. Its reports, backlog and brand stay separate."})]}),e.jsxs("form",{onSubmit:P,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(C,{htmlFor:"ws-name",children:"Company or product name"}),e.jsx(S,{id:"ws-name",value:c,onChange:r=>k(r.target.value),required:!0,maxLength:120})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(C,{htmlFor:"ws-url",children:"Website URL"}),e.jsx(S,{id:"ws-url",value:w,onChange:r=>N(r.target.value),placeholder:"https://example.com",maxLength:300})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>o(!1),disabled:u,children:"Cancel"}),e.jsx(b,{type:"submit",disabled:u||!c.trim(),children:u?"Creating...":"Create workspace"})]})]})]})})]})},Ce=[{label:"Plan",items:[{title:"Home",url:"/app",icon:ne,end:!0},{title:"Growth Report",url:"/app/report",icon:ie},{title:"Opportunities",url:"/app/opportunities",icon:le},{title:"Backlog",url:"/app/backlog",icon:Ne}]},{label:"Execute",items:[{title:"Experiments",url:"/app/experiments",icon:we},{title:"Tools",url:"/app/tools",icon:ge},{title:"Content",url:"/app/content",icon:ve},{title:"Customers",url:"/app/customers",icon:oe}]},{label:"Measure",items:[{title:"Analytics",url:"/app/analytics",icon:ce},{title:"Integrations",url:"/app/integrations",icon:fe}]},{label:"Workspace",items:[{title:"Brand",url:"/app/brand",icon:de},{title:"Settings",url:"/app/settings",icon:pe},{title:"Billing",url:"/app/billing",icon:me}]}],Se=()=>{const{state:n}=q(),a=n==="collapsed",{pathname:s}=M(),{current:i,plan:m}=f();return e.jsxs(K,{collapsible:"icon",children:[e.jsx(V,{className:"border-b border-sidebar-border p-2",children:e.jsx(ye,{collapsed:a})}),e.jsx(Y,{children:Ce.map(l=>e.jsxs(Q,{children:[!a&&e.jsx(X,{className:"font-mono text-[10px] uppercase tracking-[0.14em]",children:l.label}),e.jsx(Z,{children:e.jsx(ee,{children:l.items.map(t=>{const x=t.end?s===t.url:s.startsWith(t.url);return e.jsx(se,{children:e.jsx(ae,{asChild:!0,isActive:x,tooltip:t.title,children:e.jsxs(te,{to:t.url,end:t.end,className:"flex items-center gap-2",children:[e.jsx(t.icon,{className:"h-4 w-4 shrink-0"}),!a&&e.jsx("span",{children:t.title})]})})},t.url)})})})]},l.label))}),!a&&e.jsx(re,{className:"border-t border-sidebar-border p-3",children:e.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.jsxs("div",{className:"font-medium text-foreground",children:[m.name," plan"]}),e.jsxs("div",{className:"mt-0.5",children:[(i==null?void 0:i.credit_balance)??0," credits remaining"]})]})})]})},Le=()=>{const{loading:n,current:a}=f(),{pathname:s}=M();if(n)return e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-b-2 border-primary"})});const i=s.startsWith("/app/onboarding");return!a&&!i?e.jsx(g,{to:"/app/onboarding",replace:!0}):a&&!a.onboarding_completed&&!i?e.jsx(g,{to:"/app/onboarding",replace:!0}):i?e.jsx(L,{}):e.jsx(ue,{children:e.jsxs("div",{className:"flex min-h-screen w-full bg-background",children:[e.jsx(Se,{}),e.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsxs("header",{className:"flex h-14 items-center gap-3 border-b border-border bg-background px-4",children:[e.jsx(be,{}),e.jsx("span",{className:"font-heading text-sm text-muted-foreground",children:a==null?void 0:a.name})]}),e.jsx("div",{className:"flex-1 overflow-auto px-4 py-8 md:px-8",children:e.jsx(L,{})})]})]})})},Fe=()=>{const{user:n,isLoading:a}=xe();return a?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-b-2 border-primary"})}
21):n?e.jsxs(je,{children:[e.jsxs(he,{children:[e.jsx("title",{children:"GrowthPad Workspace"}),e.jsx("meta",{name:"robots",content:"noindex"})]}),e.jsx(Le,{})]}):e.jsx(g,{to:"/",replace:!0})};export{Fe 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.