PageSourceSearch

https://gristory-lab.lovable.app/assets/SectionPage-DgXdBDvB.js

js gristory-lab.lovable.app collected 2026-10-03 03:27:46 UTC 6,497 bytes, 1 lines download raw bytes

1import{v as I,a as P,u as O,r as n,s as N,j as e,L as T}from"./index-BPn1ExP4.js";import{u as U}from"./WorkspaceContext-CAlLnQ34.js";import{g as A}from"./sections-63iD70PD.js";import{U as $}from"./UpgradeModal-BS5ys2Pw.js";import{A as M}from"./arrow-left-DS06SIwa.js";import{L as R}from"./lock-BBUiKjcx.js";import{A as q}from"./arrow-right-ClWKDicT.js";import{U as w,D as B,T as F}from"./users-CWco-36N.js";import{P as K}from"./palette-Dvvap8we.js";import"./dialog-C_cDOFQq.js";import"./index-DJ14YzCo.js";import"./index-DbH2bNhh.js";import"./check-BhNh-DTn.js";const W={"client-system":w,"creative-process":K,"business-pricing":B,"portfolio-growth":F},b={"client-system":{accent:"var(--os-blue)",accentDim:"var(--os-blue-dim)"},"creative-process":{accent:"var(--os-purple)",accentDim:"var(--os-purple-dim)"},"business-pricing":{accent:"var(--os-orange)",accentDim:"var(--os-orange-dim)"},"portfolio-growth":{accent:"var(--os-green)",accentDim:"var(--os-green-dim)"}},z={"client-system":{en:"Stop getting bad clients. Stop scope creep. Start every project with structure.",ar:"توقف عن قبول عملاء سيئين. ابدأ كل مشروع بهيكل واضح."},"creative-process":{en:"A professional design process that clients respect — and that makes better work.",ar:"عملية تصميم احترافية يحترمها العملاء وتنتج عملاً أفضل."},"business-pricing":{en:"Know your numbers. Charge what you're worth. Protect your time.",ar:"اعرف أرقامك. تقاضَ ما تستحق. احمِ وقتك."},"portfolio-growth":{en:"Build a portfolio that attracts dream clients. Position yourself as the expert.",ar:"ابنِ محفظة أعمال تجذب عملاء الأحلام."}};function oe(){var v,j,y;const{section:r}=I(),k=P(),{workspace:d}=U(),{profile:m}=O(),[c,_]=n.useState([]),[u,S]=n.useState({}),[D,E]=n.useState(!0),[l,h]=n.useState({open:!1}),i=A(r||""),o=b[r||""]||b["client-system"],p=z[r||""],C=W[r||""]||w,L=(m==null?void 0:m.plan)||"free";if(n.useEffect(()=>{r&&N.from("tools").select("*").eq("section",r).order("sort_order").then(({data:s})=>{s&&_(s),E(!1)})},[r]),n.useEffect(()=>{d&&N.from("tool_data").select("tool_slug, status, progress_pct").eq("workspace_id",d.id).then(({data:s})=>{if(s){const t={};s.forEach(a=>{t[a.tool_slug]=a}),S(t)}})},[d]),!i)return e.jsx("div",{style:{color:"var(--os-muted)"},children:"Section not found"});const f=c.filter(s=>{var t;return((t=u[s.slug])==null?void 0:t.status)==="done"}).length,g=c.length>0?Math.round(f/c.length*100):0;return D?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"os-card p-6 animate-pulse",style:{height:160}}),[1,2,3,4].map(s=>e.jsx("div",{className:"os-card animate-pulse",style:{height:80}},s))]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("nav",{className:"flex items-center gap-2 text-xs",style:{color:"var(--os-dim)"},children:[e.jsxs(T,{to:"/os",className:"flex items-center gap-1 transition-colors",style:{color:"var(--os-dim)"},children:[e.jsx(M,{className:"h-3 w-3"})," Dashboard"]}),e.jsx("span",{children:"/"}),e.jsx("span",{style:{color:"var(--os-body)"},children:i.label})]}),e.jsx("div",{className:"os-card overflow-hidden",style:{borderLeft:`4px solid ${o.accent}`},children:e.jsx("div",{className:"p-6 sm:p-8",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"p-3 rounded-xl shrink-0",style:{background:o.accentDim},children:e.jsx(C,{className:"h-6 w-6",style:{color:o.accent}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h1",{className:"text-xl font-bold",style:{color:"var(--os-white)"},children:i.label}),e.jsx("p",{className:"text-[11px] mt-0.5 font-arabic",style:{color:"var(--os-dim)"},dir:"rtl",children:i.arLabel}),p&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm mt-2",style:{color:"var(--os-body)"},children:p.en}),e.jsx("p",{className:"text-[11px] mt-1 font-arabic",style:{color:"var(--os-dim)"},dir:"rtl",children:p.ar})]}),e.jsxs("div",{className:"mt-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("span",{className:"text-xs",style:{color:"var(--os-muted)"},children:[f,"/",c.length," tools completed"]}),e.jsxs("span",{className:"text-xs font-mono",style:{color:o.accent},children:[g,"%"]})]}),e.jsx("div",{className:"h-2 rounded-full overflow-hidden",style:{background:"var(--os-track)"},children:e.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${g}%`,background:o.accent}})})]})]})]})})}),e.jsx("div",{className:"space-y-2",children:c.map(s=>{const t=u[s.slug],a=(t==null?void 0:t.status)||"empty",x=!s.is_free&&L==="free";return e.jsxs("button",{onClick:x?()=>h({open:!0,tool:s}):()=>k(`/os/${r}/${s.slug}`),className:`w-full flex items-center gap-4 os-card p-4 text-left ${x?"opacity-50":""}`,children:[e.jsx("div",{className:"w-1 self-stretch rounded-full shrink-0",style:{background:o.accent}}),e.jsx("span",{className:"text-2xl shrink-0",children:s.emoji}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold",style:{color:"var(--os-white)"},children:s.name_en}),s.name_ar&&e.jsx("p",{className:"text-[10px] font-arabic",style:{color:"var(--os-dim)"},dir:"rtl",children:s.name_ar}),e.jsx("p",{className:"text-xs mt-0.5 line-clamp-1",style:{color:"var(--os-muted)"},children:s.description_en})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:x?e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-full",style:{background:"var(--os-surface3)",color:"var(--os-dim)"},children:[e.jsx(R,{className:"h-3 w-3"})," Upgrade"]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[10px] font-medium px-2 py-1 rounded-full",style:{background:a==="done"?"var(--os-green-dim)":a==="in_progress"?"var(--os-accent-dim)":"var(--os-surface3)",color:a==="done"?"var(--os-green)":a==="in_progress"?"var(--os-accent)":"var(--os-dim)"},children:a==="done"?"✓ Done":a==="in_progress"?`${(t==null?void 0:t.progress_pct)||0}%`:"Empty"}),e.jsxs("span",{className:"text-xs font-medium hidden sm:inline-flex items-center gap-0.5",style:{color:o.accent},children:["Open ",e.jsx(q,{className:"h-3 w-3"})]})]})})]},s.slug)})}),e.jsx($,{open:l.open,onClose:()=>h({open:!1}),toolName:(v=l.tool)==null?void 0:v.name_en,toolEmoji:(j=l.tool)==null?void 0:j.emoji,toolDescription:(y=l.tool)==null?void 0:y.description_en})]})}export{oe 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.