PageSourceSearch

https://cattok.web.app/assets/MyEarnings-CodjYFZM.js

js cattok.web.app collected 2026-10-03 12:19:59 UTC 2,920 bytes, 1 lines download raw bytes

1import{e as x,q as e,x as j,f as l}from"./index-uG2Fj7kK.js";import{f as r,L as c}from"./vendor-router-DVyPNBIY.js";import{o as b}from"./vendor-fbauth-BULzZRav.js";import"./vendor-firebase-core-Bd75sj-9.js";import{query as N,collection as w,where as v,orderBy as C,getDocs as E}from"./vendor-firestore-Dlk5HrwC.js";import"./vendor-fbstorage-Bs-_WSY5.js";import"./vendor-functions-NO_0zc2o.js";function A(){const[o,i]=r.useState(null),[a,p]=r.useState([]),[h,u]=r.useState(!1);if(r.useEffect(()=>{if(x)return b(x,async t=>{var m;i(t);const s=((m=j())==null?void 0:m.targetUid)??(t==null?void 0:t.uid)??null;if(s&&l)try{const n=N(w(l,"earnings"),v("ownerUid","==",s),C("date","desc")),y=await E(n);p(y.docs.map(g=>g.data()))}catch(n){console.warn("[earnings] read failed (no data yet?)",n)}u(!0)})},[]),!h)return e.jsx("div",{className:"p-6 text-center text-sm text-gray-500",children:"로딩 중…"});if(!o)return e.jsxs("div",{className:"px-4 py-6 md:py-20 text-center md:max-w-md md:mx-auto space-y-3",children:[e.jsx("p",{className:"text-sm text-gray-600",children:"로그인이 필요합니다."}),e.jsx(c,{to:"/login",className:"inline-block bg-ctt-green text-white font-bold px-4 py-2 rounded-md",children:"로그인하기"})]});const f=a.reduce((t,s)=>t+(Number(s.amount)||0),0),d=t=>new Intl.NumberFormat("ko-KR").format(t);return e.jsxs("div",{className:"px-4 py-6 space-y-4 md:max-w-3xl md:mx-auto md:px-6 md:py-10",children:[e.jsxs("header",{className:"flex items-baseline justify-between",children:[e.jsx("h1",{className:"text-xl md:text-2xl font-extrabold",children:"수익 내역"}),e.jsx(c,{to:"/my",className:"text-sm text-gray-500",children:"마이"})]}),e.jsxs("section",{className:"p-4 md:p-6 rounded-xl bg-ctt-green text-white",children:[e.jsx("p",{className:"text-xs md:text-sm opacity-90",children:"총 누적 수익"}),e.jsxs("p",{className:"text-2xl md:text-4xl font-extrabold mt-1",children:["₩ ",d(f)]}),e.jsxs("p",{className:"text-xs md:text-sm opacity-90 mt-1",children:[a.length,"건"]})]}),a.length===0?e.jsxs("div",{className:"p-8 text-center text-sm text-gray-500 border border-dashed border-gray-300 rounded-lg",children:["아직 등록된 수익 내역이 없습니다.",e.jsx("br",{}),e.jsx("span",{className:"text-xs",children:"캐디 라운드 결제가 발생하면 자동으로 표시됩니다."})]}):e.jsx("ul",{className:"space-y-2",children:a.map((t,s)=>
1e.jsxs("li",{className:"p-3 md:p-4 rounded-lg border border-gray-100 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-sm md:text-base",children:t.date}),t.golfCourse&&e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:t.golfCourse}),t.note&&e.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:t.note})]}),e.jsxs("p",{className:"font-bold text-ctt-green text-sm md:text-base",children:["+ ₩ ",d(t.amount)]})]},s))})]})}export{A 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.