1import{j as e}from"./index-Jy9skXX7.js";import{b as s,u as a}from"./vendor-D5QAFWVd.js";import{S as d}from"./SEO-CqkTTkXa.js";/* empty css */const n=({subscriptions:s=[]})=>e.jsxs("div",{className:"dashboard-section",id:"subscriptions",children:[e.jsx("h3",{children:"Subscriptions"}),0===s.length?e.jsx("div",{children:"No subscriptions found."}):e.jsxs("table",{className:"dashboard-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Plan"}),e.jsx("th",{children:"Status"}),e.jsx("th",{children:"Renewal Date"}),e.jsx("th",{children:"Actions"})]})}),e.jsx("tbody",{children:s.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:s.plan}),e.jsx("td",{children:s.status}),e.jsx("td",{children:s.renewalDate}),e.jsxs("td",{children:[e.jsx("button",{className:"dashboard-btn",onClick:()=>s.onRenew(s.id),children:"Renew"}),e.jsx("button",{className:"dashboard-btn",style:{marginLeft:0},onClick:()=>s.onUpgrade(s.id),children:"Upgrade"})]})]},s.id))})]})]}),t=({payments:s=[]})=>e.jsxs("div",{className:"dashboard-section",id:"payments",children:[e.jsx("h3",{children:"Payment History"}),0===s.length?e.jsx("div",{children:"No payment history found."}):e.jsxs("table",{className:"dashboard-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Invoice"}),e.jsx("th",{children:"Date"}),e.jsx("th",{children:"Amount"}),e.jsx("th",{children:"Status"})]})}),e.jsx("tbody",{children:s.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:s.invoice}),e.jsx("td",{children:s.date}),e.jsxs("td",{children:["$",s.amount.toFixed(2)]}),e.jsx("td",{children:s.status})]},s.id))})]})]}),i=({methods:s,onAdd:a,onRemove:d})=>e.jsxs("div",{className:"dashboard-section",children:[e.jsx("h3",{children:"Payment Methods"}),e.jsx("ul",{className:"dashboard-methods-list",children:0===s.length?e.jsx("li",{children:"No payment methods saved."}):s.map(s=>e.jsxs("li",{className:"dashboard-method-item",children:[e.jsxs("span",{children:[s.brand," **** **** **** ",s.last4]}),e.jsx("button",{className:"dashboard-btn",onClick:()=>d(s.id),children:"Remove"})]},s.id))}),e.jsx("button",{className:"dashboard-btn",onClick:a,children:"Add New Card"})]}),r=({onRenew:s,onUpgrade:a})=>e.jsxs("div",{className:"dashboard-section",children:[e.jsx("button",{className:"dashboard-btn",onClick:s,children:"Renew Subscription"}),e.jsx("button",{className:"dashboard-btn",onClick:a,children:"Upgrade Plan"})]}),o=({message:s,type:a})=>e.jsx("div",{className:`dashboard-notification dashboard-notification-${a||"info"}`,children:s}),c=[{id:"overview",label:"Overview"},{id:"subscriptions",label:"Subscriptions"},{id:"payments",label:"Payment History"},{id:"methods",label:"Payment Methods"}],l=({activeSection:s,setActiveSection:d})=>{const n=a();return e.jsx("nav",{className:"dashboard-sidenav",children:e.jsx("ul",{children:c.map(a=>{const t=s===a.id;return e.jsx("li",{children:e.jsxs("button",{className:"nav-button "+(t?"active":""),onClick:()=>{return e=a.id,d(e),void n("/dashboard"+("overview"===e?"":`#${e}`),{replace:!0});var e},"aria-current":t?"page":void 0,children:[a.label,t&&e.jsx("span",{className:"active-indicator"})]})},a.id)})})})},h=[{id:1,plan:"Pro",status:"Active",renewalDate:"2025-07-01",onRenew:()=>{},onUpgrade:()=>{}},{id:2,plan:"Basic",status:"Expired",renewalDate:"2024-06-01",onRenew:()=>{},onUpgrade:()=>{}}],m=[{id:1,invoice:"INV-001",date:"2025-06-01",amount:49.99,status:"Paid"},{id:2,invoice:"INV-002",date:"2025-05-01",amount:49.99,status:"Paid"}],j=[{id:1,brand:"Visa",last4:"4242"},{id:2,brand:"Mastercard",last4:"1234"}],x=()=>{const[a,c]=s.useState("overview"),[x,b]=s.useState(h),[p]=s.useState(m),[u,v]=s.useState(j),[y,N]=s.useState(null),g=e=>N({message:"Renewal initiated.",type:"info"}),w=e=>N({message:"Upgrade initiated.",type:"info"});return e.jsxs("div",{className:"dashboard-container",children:[e.jsx(d,{pageName:"dashboard"}),e.jsx(l,{activeSection:a,setActiveSection:c}),e.jsxs("div",{className:"dashboard-content",children:[y&&e.jsx(o,{message:y.message,type:y.type}),"overview"===a&&e.jsxs("div",{className:"dashboard-section",children:[e.jsx("h2",{style:{color:"#01574C",fontWeight:700},children:"Welcome to your Dashboard"}),e.jsx("p",{style:{color:"#01574C",fontWeight:500},children:"Manage your subscriptions, payments, and account settings here."})]}),"subscriptions"===a&&e.jsxs(e.Fragment,{children:[e.jsx(n,{subscriptions:x.map(e=>({...e,onRenew:g,onUpgrade:w}))}),e.jsx(r,{onRenew:()=>g(),onUpgrade:()=>w()})]}),"payments"===a&&e.jsx(t,{payments:p}),"methods"===a&&e.jsx(i,{methods:u,onAdd:()=>N({message:"Add card (Stripe/PayPal modal here).",type:"info"}),onRemove:e=>v(u.filter(s=>s.id!==e))})]})]})};export{x 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.