PageSourceSearch

https://seodoon-church-admin.web.app/assets/OfferingListPageV2-D4A7aIJ2.js

js seodoon-church-admin.web.app collected 2026-10-03 12:37:08 UTC 26,348 bytes, 38 lines download raw bytes

1import{j as e}from"./vendor-data-Z5doMMu-.js";import{b as ue,f as ge,r as a}from"./vendor-react-zNM0AU50.js";import{u as he,m as fe}from"./index-D1K3lVhu.js";import{o as N}from"./offeringService-Cuo8E004.js";import{f as H}from"./financeCloseService-C1M9uxKC.js";import{f as b,P as Q,O as be}from"./financeConstants-CXKUiVP8.js";import{z as n,aq as pe,n as v,ax as ye,ar as P,i as A,d as L,af as G,T,b as V,D as je,f as we,x as Ne,F as ve,R as Ce,aa as I,g as ke,X}from"./vendor-ui-CW5bJ11U.js";import{e as De,g as Se}from"./pdfExportService-CqxdTgGC.js";import{A as Me}from"./index.esm-NBNS-BUx.js";/* empty css                        */import"./vendor-firebase-Da9KY1q_.js";import"./vendor-charts-08G1rM8P.js";import"./jspdf.es.min-BLt6GQQp.js";import"./html2canvas.esm-CBrSDip1.js";function Fe(){const[S,f]=a.useState(!1);return a.useEffect(()=>{const y=()=>f(window.innerWidth<768);return y(),window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[]),S}function Ge({embedded:S=!1}){const f=ue(),[y]=ge(),{user:x}=he(),h=(x==null?void 0:x.churchId)||"seodoon-church",U=a.useRef(null),z=Fe(),[M,Y]=a.useState(!0),[F,J]=a.useState([]),[u,C]=a.useState([]),[Re,Ee]=a.useState(!1),[K,$e]=a.useState("grid"),[Z,R]=a.useState("all"),[d,g]=a.useState({fiscalYear:new Date().getFullYear().toString(),startDate:"",endDate:"",type:void 0,status:y.get("status")||void 0,paymentMethod:void 0,isAnonymous:void 0}),[k,ee]=a.useState(""),[E,te]=a.useState([]),[j,$]=a.useState(""),[w,B]=a.useState(null),[se,D]=a.useState(!1),O=a.useRef(null);a.useEffect(()=>{const t=s=>{O.current&&!O.current.contains(s.target)&&D(!1)};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[]),a.useEffect(()=>{p()},[h,d.fiscalYear,d.type,d.status,d.paymentMethod,d.startDate,d.endDate]),a.useEffect(()=>{re()},[]);const re=async()=>{try{const s=(await fe.getMembers()).filter(r=>r.member_classification==="서둔출석성도");te(s)}catch(t){console.error("교인 목록 로드 실패:",t)}},_=a.useMemo(()=>{if(!j.trim())return E.slice(0,50);const t=j.toLowerCase();return E.filter(s=>{var r,c;return((r=s.name)==null?void 0:r.toLowerCase().includes(t))||((c=s.phone)==null?void 0:c.includes(t))}).slice(0,50)},[E,j]),p=async()=>{try{Y(!0);const t=await N.getOfferings(h,d);J(t)}catch(t){console.error("헌금 목록 로드 실패:",t),n.error("헌금 목록을 불러오는데 실패했습니다")}finally{Y(!1)}},ae=t=>{R(t);const s=new Date,r=s.toISOString().split("T")[0];switch(t){case"today":g(l=>({...l,startDate:r,endDate:r,status:void 0}));break;case"thisWeek":const c=new Date(s);c.setDate(s.getDate()-s.getDay()),g(l=>({...l,startDate:c.toISOString().split("T")[0],endDate:r,status:void 0}));break;case"thisMonth":const o=new Date(s.getFullYear(),s.getMonth(),1);g(l=>({...l,startDate:o.toISOString().split("T")[0],endDate:r,status:void 0}));break;case"pending":g(l=>({...l,startDate:"",endDate:"",status:"pending"}));break;case"confirmed":g(l=>({...l,startDate:"",endDate:"",status:"confirmed"}));break;default:g(l=>({...l,startDate:"",endDate:"",status:void 0}))}},i=a.useMemo(()=>{let t=F;if(w&&(t=t.filter(s=>s.memberId===w.id)),k){const s=k.toLowerCase();t=t.filter(r=>{var c,o,l;return((c=r.memberName)==null?void 0:c.toLowerCase().includes(s))||((o=r.typeName)==null?void 0:o.toLowerCase().includes(s))||((l=r.memo)==null?void 0:l.toLowerCase().includes(s))})}return t},[F,k,w]),m=a.useMemo(()=>{const t=i.reduce((o,l)=>o+l.amount,0),s=i.filter(o=>o.status==="pending"),r=i.filter(o=>o.status==="confirmed"),c={};return i.forEach(o=>{const l=o.typeName||"기타";c[l]=(c[l]||0)+o.amount}),{total:t,count:i.length,pendingCount:s.length,pendingAmount:s.reduce((o,l)=>o+l.amount,0),confirmedCount:r.length,confirmedAmount:r.reduce((o,l)=>o+l.amount,0),byType:c}},[i]),W=async t=>{try{await N.confirmOffering(h,t,(x==null?void 0:x.uid)||""),n.success("헌금이 확정되었습니다"),p()}catch(s){console.error("헌금 확정 실패:",s),n.error("헌금 확정에 실패했습니다")}},le=async()=>{if(u.length===0){n.error("선택된 항목이 없습니다");return}const t=u.filter(s=>s.status==="pending");if(t.length===0){n.error("확정 대기 중인 항목이 없습니다");return}try{const s=t.map(r=>r.id);await N.confirmOfferingsBatch(h,s,(x==null?void 0:x.uid)||""),n.success(`${t.length}건이 확정되었습니다`),C([]),p()}catch(s){console.error("일괄 확정 실패:",s),n.error("일괄 확정에 실패했습니다")}},ne=async()=>
1{if(u.length===0){n.error("선택된 항목이 없습니다");return}if(confirm(`선택한 ${u.length}건을 삭제하시겠습니까?`))try{const t=new Set(u.map(s=>(s.date||"").slice(0,7)));for(const s of t)if(s&&await H.isMonthClosed(h,`${s}-01`)){n.error("마감된 월의 헌금이 포함되어 있어 삭제할 수 없습니다.");return}for(const s of u)await N.deleteOffering(h,s.id);n.success(`${u.length}건이 삭제되었습니다`),C([]),p()}catch(t){console.error("일괄 삭제 실패:",t),n.error("일괄 삭제에 실패했습니다")}},q=async t=>{if(confirm("정말 삭제하시겠습니까?"))try{const s=F.find(r=>r.id===t);if(s&&await H.isMonthClosed(h,s.date)){n.error("마감된 월의 헌금은 삭제할 수 없습니다.");return}await N.deleteOffering(h,t),n.success("헌금이 삭제되었습니다"),p()}catch(s){console.error("헌금 삭제 실패:",s),n.error("헌금 삭제에 실패했습니다")}},oe=()=>{if(i.length===0){n.error("내보낼 데이터가 없습니다");return}try{De(i,`헌금목록_${d.fiscalYear}`),n.success("Excel 파일이 다운로드되었습니다")}catch(t){console.error("Excel 내보내기 실패:",t),n.error("Excel 내보내기에 실패했습니다")}},ce=async()=>{if(i.length===0){n.error("내보낼 데이터가 없습니다");return}try{n.loading("PDF 생성 중...",{id:"pdf-export"}),await Se(i,`${d.fiscalYear}년 헌금 내역서`,"서둔교회"),n.success("PDF 파일이 다운로드되었습니다",{id:"pdf-export"})}catch(t){console.error("PDF 내보내기 실패:",t),n.error("PDF 내보내기에 실패했습니다",{id:"pdf-export"})}},ie=a.useCallback(t=>{if(!t.data)return"";switch(t.data.status){case"pending":return"bg-amber-50/50";case"cancelled":return"bg-red-50/50";default:return""}},[]),de=a.useMemo(()=>[{field:"date",headerName:"날짜",width:120,headerCheckboxSelection:!0,checkboxSelection:!0,sort:"desc",cellRenderer:t=>e.jsxs("div",{className:"flex items-center gap-2 h-full",children:[e.jsx(pe,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),e.jsx("span",{className:"text-gray-700",children:t.value})]})},{field:"memberName",headerName:"헌금자",width:130,cellRenderer:t=>{var r;const s=(r=t.data)==null?void 0:r.isAnonymous;return e.jsxs("div",{className:"flex items-center gap-2 h-full",children:[e.jsx("div",{className:`w-7 h-7 rounded-full flex items-center justify-center flex-shrink-0 ${s?"bg-gray-100":"bg-blue-100"}`,children:e.jsx(v,{className:`w-3.5 h-3.5 ${s?"text-gray-400":"text-blue-600"}`})}),e.jsx("span",{className:`truncate ${s?"text-gray-400 italic":"text-gray-900 font-medium"}`,children:s?"익명":t.value||"-"})]})}},{field:"typeName",headerName:"헌금 유형",width:110,cellRenderer:t=>{const r={십일조:"bg-emerald-100 text-emerald-700",감사헌금:"bg-blue-100 text-blue-700",주일헌금:"bg-blue-100 text-blue-700",건축헌금:"bg-amber-100 text-amber-700",선교헌금:"bg-rose-100 text-rose-700"}[t.value]||"bg-gray-100 text-gray-700";return e.jsx("span",{className:`px-2.5 py-1 rounded-full text-xs font-medium ${r}`,children:t.value})}},{field:"amount",headerName:"금액",width:140,type:"numericColumn",valueFormatter:t=>b(t.value),cellRenderer:t=>e.jsx("div",{className:"flex items-center gap-1.5 h-full justify-end",children:e.jsx("span",{className:"text-gray-900 font-semibold tabular-nums",children:b(t.value)})}),cellClass:"text-right"},{field:"paymentMethod",headerName:"결제",width:90,cellRenderer:t=>{const s=Q.find(c=>c.value===t.value),r={cash:"💵",transfer:"🏦",card:"💳",check:"📝"};return e.jsxs("div",{className:"flex items-center gap-1.5 h-full",children:[e.jsx("span",{children:r[t.value]||"💰"}),e.jsx("span",{className:"text-gray-600 text-sm",children:(s==null?void 0:s.label)||t.value})]})}},{field:"status",headerName:"상태",width:100,cellRenderer:t=>{const r={pending:{label:"대기",icon:A,color:"text-amber-600 bg-amber-50 border-amber-200"},confirmed:{label:"확정",icon:P,color:"text-emerald-600 bg-emerald-50 border-emerald-200"},cancelled:{label:"취소",icon:ye,color:"text-red-600 bg-red-50 border-red-200"}}[t.value]||{label:t.value,icon:A,color:"text-gray-600 bg-gray-50 border-gray-200"},c=r.icon;return e.jsxs("div",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md border text-xs font-medium ${r.color}`,children:[e.jsx(c,{className:"w-3 h-3"}),r.label]})}},{field:"memo",headerName:"메모",flex:1,minWidth:150,cellRenderer:t=>e.jsx("span",{className:"text-gray-500 text-sm truncate",children:t.value||"-"})},{headerName:"작업",width:110,sortable:!1,filter:!1,pinned:"right",cellRenderer:t=>{const s=t.data;return e.jsxs("div",{className:"flex items-center gap-0.5 h-full",children:[s.status==="pending"&&e.jsx("button",{onClick:r=>{r.stopPropagation(),W(s.id)},className:"p-1.5 text-emerald-600 hover:bg-emerald-50 rounded-lg transition-colors",title:"확정",children:e.jsx(L,{className:"w-4 h-4"})}),e.jsx("button",{onClick:r=>{r.stopPropagation(),f(`/finance/offerings/${s.id}/edit`)},className:"p-1.5 text-blue-600 hover:bg-blue-50 rounded-lg transition-colors",title:"수정",children:e.jsx(G,{className:"w-4 h-4"})}),e.jsx("button",{onClick:r=>{r.stopPropagation(),q(s.id)},className:"p-1.5 text-red-500 hover:bg-red-50 rounded-lg transition-colors",title:"삭제",children:e.jsx(T,{className:"w-4 h-4"})})]})}}],[f,h,x]),me=a.useMemo(()=>i.length===0?[]:[{id:"total",date:"합계",memberName:`${i.length}ê±´`,typeName:"",amount:m.total,paymentMethod:"",status:"",memo:""}],[i,m]),xe=a.useCallback(t=>{t.api.sizeColumnsToFit()},[]);return e.jsxs("div",{className:"h-full flex flex-col",children:[!S&&e.jsx("div",{className:"bg-white border-b border-gray-200 px-4 md:px-6 py-3 md:py-4",children:e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-3 md:gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-gray-900",children:"헌금 관리"}),e.jsxs("div",{className:"hidden md:flex items-center gap-4 mt-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 bg-emerald-100 rounded-lg flex items-center justify-center",children:e.jsx(V,{className:"w-3.5 h-3.5 text-emerald-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:"총 헌금액"}),e.jsx("p",{className:"text-sm font-bold text-gray-900",children:b(m.total)})]})]}),e.jsx("div",{className:"h-8 w-px bg-gray-200"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 bg-amber-100 rounded-lg flex items-center justify-center",children:e.jsx(A,{className:"w-4 h-4 text-amber-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:"대기"}),e.jsxs("p",{className:"text-sm font-semibold text-amber-600",children:[m.pendingCount,"ê±´"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 bg-emerald-100 rounded-lg flex items-center justify-center",children:e.jsx(P,{className:"w-4 h-4 text-emerald-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:"확정"}),e.jsxs("p",{className:"text-sm font-semibold text-emerald-600",children:[m.confirmedCount,"ê±´"]})]})]})]}),e.jsxs("p",{className:"md:hidden text-sm text-gray-500 mt-1",children:[m.count,"ê±´ · ",b(m.total)]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"hidden md:block relative",children:[e.jsxs("button",{onClick:()=>{var t;return(t=document.getElementById("export-menu"))==null?void 0:t.classList.toggle("hidden")},className:"flex items-center gap-2 px-3 py-2 border border-gray-200 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",children:[e.jsx(je,{className:"w-4 h-4"}),"내보내기",e.jsx(we,{className:"w-4 h-4"})]}),e.jsxs("div",{id:"export-menu",className:"hidden absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-lg shadow-lg z-10",children:[e.jsxs("button",{onClick:()=>{var t;oe(),(t=document.getElementById("export-menu"))==null||t.classList.add("hidden")},className:"w-full flex items-center gap-2 px-4 py-2.5 text-sm text-gray-700 hover:bg-gray-50",children:[e.jsx(Ne,{className:"w-4 h-4 text-green-600"}),"Excel 다운로드"]}),e.jsxs("button",{onClick:()=>{var t;ce(),(t=document.getElementById("export-menu"))==null||t.classList.add("hidden")},className:"w-full flex items-center gap-2 px-4 py-2.5 text-sm text-gray-700 hover:bg-gray-50",children:[e.jsx(ve,{className:"w-4 h-4 text-red-600"}),"PDF 다운로드"]})]})]}),e.jsx("button",{onClick:p,className:"p-2 border border-gray-200 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",title:"새로고침",children:e.jsx(Ce,{className:`w-4 h-4 ${M?"animate-spin":""}`})}),e.jsxs("button",{onClick:()=>f("/finance/offerings/bulk"),className:"hidden md:flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors shadow-sm",children:[e.jsx(I,{className:"w-4 h-4"}),"일괄입력"]}),e.jsxs("button",{onClick:()=>f("/finance/offerings/new"),className:"hidden md:flex items-center gap-2 px-4 py-2 bg-emerald-600 text-white rounded-lg hover:bg-emerald-700 transition-colors shadow-sm",children:[e.jsx(I,{className:"w-4 h-4"}),"헌금 등록"]})]})]})}),e.jsx("div",{className:"bg-gray-50 border-b border-gray-200 px-4 md:px-6 py-3",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:gap-3",children:[e.jsx("div",{className:"flex items-center gap-1 p-1 bg-white rounded-lg border border-gray-200 overflow-x-auto max-w-full md:max-w-none",children:[{key:"all",label:"전체"},{key:"today",label:"오늘"},{key:"thisWeek",label:"이번 주"},{key:"thisMonth",label:"이번 달"},{key:"pending",label:"대기중"},{key:"confirmed",label:"확정"}].map(({key:t,label:s})=>e.jsx("button",{onClick:()=>ae(t),className:`px-2.5 md:px-3 py-1.5 text-xs md:text-sm font-medium rounded-md transition-colors whitespace-nowrap ${Z===t?"bg-blue-600 text-white":"text-gray-600 hover:bg-gray-100"}`,children:s},t))}),e.jsx("div",{className:"hidden md:block h-6 w-px bg-gray-300"}),e.jsx("select",{value:d.fiscalYear,onChange:t=>g(s=>({...s,fiscalYear:t.target.value})),className:"px-2 md:px-3 py-2 bg-white border border-gray-200 rounded-lg text-xs md:text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",children:[...Array(5)].map((t,s)=>{const r=new Date().getFullYear()-s;return e.jsxs("option",{value:r.toString(),children:[r,"년"]},r)})}),e.jsxs("select",{value:d.type||"",onChange:t=>g(s=>({...s,type:t.target.value||void 0})),className:"hidden md:block px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",children:[e.jsx("option",{value:"",children:"전체 유형"}),be.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))]}),e.jsxs("div",{className:"hidden lg:flex items-center gap-1",children:[e.jsx("input",{type:"date",value:d.startDate,onChange:t=>{g(s=>({...s,startDate:t.target.value})),R("all")},className:"px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"}),e.jsx("span",{className:"text-gray-400",children:"~"}),e.jsx("input",{type:"date",value:d.endDate,onChange:t=>{g(s=>({...s,endDate:t.target.value})),R("all")},className:"px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"relative w-full md:w-auto md:min-w-[200px]",children:[e.jsx(ke,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx("input",{type:"text",placeholder:"검색...",value:k,onChange:t=>ee(t.target.value),className:"w-full pl-9 pr-4 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),e.jsx("div",{ref:O,className:"hidden md:block relative min-w-[180px]",children:w?e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-blue-50 border border-blue-300 rounded-lg",children:[e.jsx(v,{className:"w-4 h-4 text-blue-600"}),e.jsx("span",{className:"text-blue-800 font-medium text-sm",children:w.name}),e.jsx("button",{onClick:()=>{B(null),$("")},className:"ml-auto p-0.5 hover:bg-blue-100 rounded",children:e.jsx(X,{className:"w-4 h-4 text-blue-600"})})]}):e.jsxs(e.Fragment,{children:[e.jsx(v,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx("input",{type:"text",placeholder:"교인 검색...",value:j,onChange:t=>{$(t.target.value),D(!0)},onFocus:()=>D(!0),className:"w-full pl-9 pr-4 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"}),se&&e.jsx("div",{className:"absolute z-50 w-full mt-1 bg-white border border-gray-200 rounded-lg shadow-lg max-h-64 overflow-y-auto",children:_.length===0?e.jsx("div",{className:"p-3 text-center text-gray-500 text-sm",children:j?"검색 ê²°ê
1³¼ê°€ 없습니다":"교인 없음"}):e.jsx("ul",{children:_.map(t=>e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>{B({id:t.id,name:t.name}),$(""),D(!1)},className:"w-full px-3 py-2 text-left hover:bg-gray-50 flex items-center gap-2 border-b border-gray-100 last:border-b-0",children:[t.photo_url?e.jsx("img",{src:t.photo_url,alt:t.name,className:"w-7 h-7 rounded-full object-cover"}):e.jsx("div",{className:"w-7 h-7 rounded-full bg-gray-200 flex items-center justify-center",children:e.jsx(v,{className:"w-3.5 h-3.5 text-gray-500"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-gray-900 text-sm",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500 truncate",children:t.detailed_position||t.position||"성도"})]})]})},t.id))})})]})})]})}),u.length>0&&e.jsxs("div",{className:"bg-blue-50 border-b border-blue-200 px-6 py-2.5 flex items-center gap-4",children:[e.jsxs("span",{className:"text-sm font-medium text-blue-800",children:[u.length,"ê±´ 선택됨"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:le,className:"flex items-center gap-1.5 px-3 py-1.5 bg-emerald-600 text-white text-sm font-medium rounded-lg hover:bg-emerald-700 transition-colors",children:[e.jsx(L,{className:"w-4 h-4"}),"일괄 확정"]}),e.jsxs("button",{onClick:ne,className:"flex items-center gap-1.5 px-3 py-1.5 bg-red-600 text-white text-sm font-medium rounded-lg hover:bg-red-700 transition-colors",children:[e.jsx(T,{className:"w-4 h-4"}),"일괄 삭제"]}),e.jsxs("button",{onClick:()=>C([]),className:"flex items-center gap-1.5 px-3 py-1.5 text-gray-600 text-sm font-medium rounded-lg hover:bg-blue-100 transition-colors",children:[e.jsx(X,{className:"w-4 h-4"}),"선택 해제"]})]}),e.jsxs("div",{className:"ml-auto text-sm text-blue-700",children:["선택 합계: ",e.jsx("span",{className:"font-bold",children:b(u.reduce((t,s)=>t+s.amount,0))})]})]}),z||K==="card"?e.jsx("div",{className:"flex-1 bg-gray-50 overflow-auto",children:M?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})}):i.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-gray-400",children:[e.jsx(V,{className:"w-12 h-12 mb-3 opacity-50"}),e.jsx("p",{children:"헌금 데이터가 없습니다"})]}):e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsx("div",{className:"fin-stat fin-stat-pos rounded-xl p-4 shadow-sm",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500 text-xs",children:"총 헌금액"}),e.jsx("p",{className:"text-lg font-bold mt-1 text-gray-900 tabular-nums",children:b(m.total)})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("p",{className:"text-gray-500 text-sm",children:[m.count,"ê±´"]}),e.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["대기 ",m.pendingCount," | 확정 ",m.confirmedCount]})]})]})}),i.map(t=>{var o;const r={십일조:"bg-emerald-100 text-emerald-700 border-emerald-200",감사헌금:"bg-blue-100 text-blue-700 border-blue-200",주일헌금:"bg-blue-100 text-blue-700 border-blue-200",건축헌금:"bg-amber-100 text-amber-700 border-amber-200",선교헌금:"bg-rose-100 text-rose-700 border-rose-200"}[t.typeName||""]||"bg-gray-100 text-gray-700 border-gray-200",c=t.status==="pending";return e.jsxs("div",{className:`bg-white rounded-xl border shadow-sm overflow-hidden ${c?"border-amber-200 bg-amber-50/30":"border-gray-100"}`,children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-full flex items-center justify-center ${t.isAnonymous?"bg-gray-100":"bg-blue-100"}`,children:e.jsx(v,{className:`w-5 h-5 ${t.isAnonymous?"text-gray-400":"text-blue-600"}`})}),e.jsxs("div",{children:[e.jsx("p",{className:`font-medium ${t.isAnonymous?"text-gray-400 italic":"text-gray-900"}`,children:t.isAnonymous?"익명":t.memberName||"-"}),e.jsx("p",{className:"text-xs text-gray-500",children:t.date})]})]}),e.jsx("div",{className:`px-2.5 py-1 rounded-full text-xs font-medium border ${r}`,children:t.typeName})]}),e.jsx("div",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-lg font-bold text-gray-900",children:b(t.amount)}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("span",{className:"text-xs text-gray-500",children:((o=Q.find(l=>l.value===t.paymentMethod))==null?void 0:o.label)||t.paymentMethod}),t.memo&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-300",children:"•"}),e.jsx("span",{className:"text-xs text-gray-500 truncate max-w-[120px]",children:t.memo})]})]})]}),e.jsx("div",{className:"flex items-center gap-1",children:c?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>W(t.id),className:"p-2 bg-emerald-100 text-emerald-600 rounded-lg hover:bg-emerald-200 transition-colors",title:"확정",children:e.jsx(L,{className:"w-5 h-5"})}),e.jsx("span",{className:"px-2 py-1 bg-amber-100 text-amber-700 text-xs font-medium rounded-lg",children:"대기"})]}):e.jsxs("span",{className:"px-2 py-1 bg-emerald-100 text-emerald-700 text-xs font-medium rounded-lg flex items-center gap-1",children:[e.jsx(P,{className:"w-3.5 h-3.5"}),"확정"]})})]})}),e.jsxs("div",{className:"flex items-center justify-end gap-1 px-3 py-2 bg-gray-50 border-t border-gray-100",children:[e.jsxs("button",{onClick:()=>f(`/finance/offerings/${t.id}/edit`),className:"flex items-center gap-1.5 px-3 py-1.5 text-blue-600 text-sm hover:bg-blue-50 rounded-lg transition-colors",children:[e.jsx(G,{className:"w-4 h-4"}),"수정"]}),e.jsxs("button",{onClick:()=>
1q(t.id),className:"flex items-center gap-1.5 px-3 py-1.5 text-red-500 text-sm hover:bg-red-50 rounded-lg transition-colors",children:[e.jsx(T,{className:"w-4 h-4"}),"삭제"]})]})]},t.id)})]})}):e.jsxs("div",{className:"flex-1 bg-white",children:[e.jsx("style",{children:`
2            .ag-theme-alpine {
3              --ag-header-background-color: #f9fafb;
4              --ag-header-foreground-color: #374151;
5              --ag-odd-row-background-color: #ffffff;
6              --ag-row-hover-color: #f3f4f6;
7              --ag-selected-row-background-color: #dbeafe;
8              --ag-range-selection-border-color: #3b82f6;
9              --ag-border-color: #e5e7eb;
10              --ag-row-border-color: #f3f4f6;
11              --ag-font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
12              --ag-font-size: 13px;
13            }
14            .ag-theme-alpine .ag-header-cell {
15              font-weight: 600;
16              font-size: 12px;
17            }
18            .ag-theme-alpine .ag-row {
19              border-bottom: 1px solid var(--ag-row-border-color);
20            }
21            .ag-theme-alpine .ag-row-selected {
22              background-color: var(--ag-selected-row-background-color) !important;
23            }
24            .ag-theme-alpine .ag-cell {
25              display: flex;
26              align-items: center;
27            }
28            .ag-theme-alpine .ag-row-pinned {
29              background-color: #f0fdf4;
30              font-weight: 600;
31            }
32            .bg-amber-50\\/50 {
33              background-color: rgba(255, 251, 235, 0.5);
34            }
35            .bg-red-50\\/50 {
36              background-color: rgba(254, 242, 242, 0.5);
37            }
38          `}),e.jsx("div",{className:"ag-theme-alpine h-full w-full",children:e.jsx(Me,{ref:U,rowData:i,columnDefs:de,defaultColDef:{sortable:!0,filter:!0,resizable:!0},rowSelection:"multiple",suppressRowClickSelection:!0,onSelectionChanged:t=>C(t.api.getSelectedRows()),animateRows:!0,loading:M,getRowClass:ie,pinnedBottomRowData:me,onGridReady:xe,suppressCellFocus:!0,enableCellTextSelection:!0,overlayNoRowsTemplate:"<div class='flex flex-col items-center justify-center py-12'><svg class='w-12 h-12 text-gray-300 mb-3' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4'></path></svg><p class='text-gray-400'>데이터가 없습니다</p></div>"})})]}),z&&e.jsx("button",{onClick:()=>f("/finance/offerings/new"),className:"fixed bottom-6 right-6 w-14 h-14 bg-emerald-600 text-white rounded-full shadow-sm flex items-center justify-center hover:bg-emerald-700 transition-colors z-50",children:e.jsx(I,{className:"w-6 h-6"})})]})}export{Ge as OfferingListPageV2};

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.