1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9783],{89783:function(e,t,r){r.r(t),r.d(t,{default:function(){return l}});var n=r(57437),s=r(2265),i=r(42586),a=r(16998),c=r(79901);function l(e){let{locale:t}=e,r=(0,i.useTranslations)("Dashboard"),[l,o]=(0,s.useState)([]),[d,u]=(0,s.useState)(!0),[h,p]=(0,s.useState)(null),x=async()=>{u(!0),p(null);try{let e=await fetch("/api/subscriptions");if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to fetch subscriptions")}let t=await e.json();o(t)}catch(e){console.error("Error fetching subscriptions:",e),p(e instanceof Error?e.message:"An error occurred while fetching subscriptions"),a.FN.error({content:e instanceof Error?e.message:"An error occurred while fetching subscriptions",duration:3})}finally{u(!1)}};(0,s.useEffect)(()=>{x()},[]);let y=e=>e?new Date(e).toLocaleDateString("zh"===t?"zh-CN":"en-US",{year:"numeric",month:"short",day:"numeric"}):"",f=(e,r)=>e?new Intl.NumberFormat("zh"===t?"zh-CN":"en-US",{style:"currency",currency:r||"USD"}).format(e):"",j=[{title:r("plan"),dataIndex:"plan_name",render:e=>(0,n.jsx)(a.Typography.Text,{strong:!0,children:e})},{title:r("status"),dataIndex:"status",render:e=>{switch(e){case"active":return(0,n.jsx)(a.Vp,{color:"green",children:r("statusActive")});case"expired":return(0,n.jsx)(a.Vp,{color:"grey",children:r("statusExpired")});case"cancelled":return(0,n.jsx)(a.Vp,{color:"red",children:r("statusCancelled")});default:return(0,n.jsx)(a.Vp,{children:e})}}},{title:r("price"),render:(e,t)=>f(t.price,t.currency)},{title:r("startDate"),dataIndex:"start_date",render:e=>y(e)},{title:r("endDate"),dataIndex:"end_date",render:e=>y(e)}];return(0,n.jsx)(a.Zb,{className:"subscription-card",title:(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,n.jsx)(a.Typography.Title,{heading:3,children:r("mySubscriptions")}),(0,n.jsx)(a.zx,{icon:(0,n.jsx)(c.Z,{}),onClick:()=>{x()},type:"tertiary",children:r("refresh")})]}),children:d?(0,n.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:"40px"},children:(0,n.jsx)(a.yC,{size:"large"})}):h?(0,n.jsx)(a.HY,{description:h}):0===l.length?(0,n.jsx)(a.HY,{description:r("noSubscriptions")}):(0,n.jsx)(a.iA,{columns:j,dataSource:l,pagination:!1,rowKey:"id"})})}}}]);
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.