PageSourceSearch

https://seodoon-church-admin.web.app/assets/AcademyManagementPage-C7_HEjXM.js

js seodoon-church-admin.web.app collected 2026-10-03 12:36:17 UTC 26,016 bytes, 3 lines download raw bytes

1import{j as e}from"./vendor-data-Z5doMMu-.js";import{r as b}from"./vendor-react-zNM0AU50.js";import{r as y,K as L,U as $,s as H,ar as K,i as X,A as I,aa as J,n as Q,ah as V,a7 as m,X as P,Y as W,a8 as Z}from"./vendor-ui-CW5bJ11U.js";import{y as R,k as v,u as B,z as ee,l as w,q as A,x as k,m as S,w as te,D as se,G as ae,E as le}from"./vendor-firebase-Da9KY1q_.js";import{d as p,s as ne}from"./index-D1K3lVhu.js";import"./vendor-charts-08G1rM8P.js";const M="seodoon-church",f=`churches/${M}/academyPrograms`,N=`churches/${M}/academyEnrollments`,C={async getAll(){try{const s=A(w(p,f),k("sortOrder","asc"));return(await S(s)).docs.map(c=>({id:c.id,...c.data()}))}catch(s){return console.error("아카데미 강좌 조회 실패:",s),[]}},async create(s){return(await ee(w(p,f),{...s,createdAt:new Date,updatedAt:new Date})).id},async update(s,r){const c=v(p,f,s);await B(c,{...r,updatedAt:new Date})},async remove(s){await R(v(p,f,s))}},T={async getAll(){try{const s=A(w(p,N),k("createdAt","desc"));return(await S(s)).docs.map(c=>{var i,x;const d=c.data();return{id:c.id,...d,createdAt:((x=(i=d.createdAt)==null?void 0:i.toDate)==null?void 0:x.call(i))||d.createdAt}})}catch(s){return console.error("수강신청 조회 실패:",s),[]}},async getByProgram(s){try{const r=A(w(p,N),te("programId","==",s),k("createdAt","desc"));return(await S(r)).docs.map(d=>{var x,h;const i=d.data();return{id:d.id,...i,createdAt:((h=(x=i.createdAt)==null?void 0:x.toDate)==null?void 0:h.call(x))||i.createdAt}})}catch(r){return console.error("강좌별 수강신청 조회 실패:",r),[]}},async updateStatus(s,r){const c=v(p,N,s);await B(c,{status:r})},async remove(s){await R(v(p,N,s))}},E={sunday:"주일아카데미",thursday:"목요신앙",special:"특별강좌"},D={upcoming:"운영예정",recruiting:"모집중",active:"운영중",closed:"종강"},re={pending:"대기",confirmed:"확인",cancelled:"취소"};function _(s){switch(s){case"upcoming":return"bg-slate-100 text-slate-600";case"recruiting":return"bg-blue-100 text-blue-700";case"active":return"bg-green-100 text-green-700";case"closed":return"bg-gray-100 text-gray-500"}}function ge(){const[s,r]=b.useState("dashboard"),[c,d]=b.useState([]),[i,x]=b.useState([]),[h,l]=b.useState(!0),t=b.useCallback(async()=>{l(!0);const[o,j]=await Promise.all([C.getAll(),T.getAll()]);d(o),x(j),l(!1)},[]);b.useEffect(()=>{t()},[t]);const n=[{id:"dashboard",label:"대시보드",icon:L},{id:"programs",label:"강좌 관리",icon:y},{id:"enrollments",label:"수강신청 관리",icon:$}];return e.jsxs("div",{className:"space-y-0",children:[e.jsx("div",{className:"rounded-xl p-6 bg-white border border-gray-200 mb-5",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-blue-50 rounded-lg flex items-center justify-center",children:e.jsx(y,{className:"w-5 h-5 text-blue-600"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-[18px] font-bold text-gray-900",children:"서둔아카데미 관리"}),e.jsx("p",{className:"text-[12px] text-gray-500 mt-0.5",children:"강좌와 수강신청을 관리합니다"})]})]}),e.jsxs("div",{className:"bg-slate-50 border border-gray-200 rounded-lg px-4 py-2 text-center",children:[e.jsxs("div",{className:"text-[11px] text-gray-500 flex items-center gap-1",children:[e.jsx(y,{className:"w-3 h-3"}),"전체 강좌"]}),e.jsxs("div",{className:"text-[22px] font-bold leading-tight text-gray-900 tabular-nums",children:[c.length,e.jsx("span",{className:"text-[13px] font-normal ml-0.5",children:"개"})]})]})]})}),e.jsx("div",{className:"flex gap-1 border-b border-gray-200 mb-4",children:n.map(o=>e.jsxs("button",{onClick:()=>r(o.id),className:`flex items-center gap-1.5 px-4 py-2.5 text-[13px] font-medium border-b-2 -mb-[1px] transition-colors ${s===o.id?"border-[#2C5F8A] text-[#2C5F8A]":"border-transparent text-gray-500 hover:text-gray-700"}`,children:[e.jsx(o.icon,{className:"w-4 h-4"}),o.label]},o.id))}),h?e.jsx("div",{className:"text-center py-16 text-gray-400 text-[13px]",children:"로딩 중..."}):e.jsxs(e.Fragment,{children:[s==="dashboard"&&e.jsx(ce,{programs:c,enrollments:i}),s==="programs"&&e.jsx(de,{programs:c,onReload:t}),s==="enrollments"&&e.jsx(ie,{programs:c,enrollments:i,onReload:t})]})]})}function ce({programs:s,enrollments:r}){const c=s.filter(l=>l.status==="active"||l.status==="recruiting"),d=r.filter(l=>l.status==="confirmed").length,i=r.filter(l=>l.status==="pending").length,x=[{label:"전체 강좌",value:s.length,unit:"개",color:"#2C5F8A",bg:"#EBF2F8",icon:y},{label:"진행중 강좌",value:c.length,unit:"개",color:"#16a34a",bg
1:"#f0fdf4",icon:H},{label:"총 신청",value:r.length,unit:"건",color:"#2563eb",bg:"#eff6ff",icon:$},{label:"확정",value:d,unit:"건",color:"#2563eb",bg:"#eff6ff",icon:K},{label:"대기",value:i,unit:"건",color:"#d97706",bg:"#fffbeb",icon:X}],h=s.map(l=>{const t=r.filter(n=>n.programId===l.id);return{...l,total:t.length,confirmed:t.filter(n=>n.status==="confirmed").length,pending:t.filter(n=>n.status==="pending").length,cancelled:t.filter(n=>n.status==="cancelled").length}});return e.jsxs("div",{className:"space-y-5",children:[e.jsx("div",{className:"grid grid-cols-5 gap-3",children:x.map((l,t)=>e.jsxs("div",{className:"rounded-xl p-4 border",style:{backgroundColor:l.bg,borderColor:`${l.color}20`},children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-[11px] font-medium",style:{color:l.color},children:l.label}),e.jsx(l.icon,{className:"w-4 h-4",style:{color:l.color,opacity:.5}})]}),e.jsxs("div",{className:"text-[24px] font-bold leading-tight",style:{color:l.color},children:[l.value,e.jsx("span",{className:"text-[12px] font-normal ml-0.5",children:l.unit})]})]},t))}),i>0&&e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-3 flex items-center gap-2",children:[e.jsx(I,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}),e.jsxs("span",{className:"text-[13px] text-amber-700",children:["확인 대기 중인 수강신청이 ",e.jsxs("strong",{children:[i,"건"]})," 있습니다."]})]}),e.jsxs("div",{className:"bg-white rounded-xl border p-4",children:[e.jsxs("h3",{className:"text-[14px] font-bold text-gray-900 mb-3 flex items-center gap-2",children:[e.jsx(L,{className:"w-4 h-4 text-[#2C5F8A]"}),"강좌별 신청 현황"]}),h.length===0?e.jsx("div",{className:"text-center py-8 text-gray-400 text-[13px]",children:"등록된 강좌가 없습니다"}):e.jsx("div",{className:"space-y-2.5",children:h.map(l=>e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg hover:bg-gray-100 transition-colors",children:[e.jsx("span",{className:`inline-block px-2 py-0.5 rounded text-[11px] font-medium flex-shrink-0 ${l.category==="sunday"?"bg-blue-100 text-blue-700":(l.category==="thursday","bg-slate-100 text-slate-700")}`,children:E[l.category]}),e.jsx("span",{className:"text-[13px] font-medium text-gray-900 flex-1 truncate",children:l.name}),e.jsx("span",{className:`text-[12px] px-2 py-0.5 rounded ${_(l.status)}`,children:D[l.status]}),e.jsxs("div",{className:"flex items-center gap-3 ml-2 text-[12px]",children:[e.jsxs("span",{className:"text-gray-500",children:["신청 ",e.jsx("strong",{className:"text-gray-800",children:l.total})]}),e.jsxs("span",{className:"text-green-600",children:["확정 ",e.jsx("strong",{children:l.confirmed})]}),e.jsxs("span",{className:"text-amber-600",children:["대기 ",e.jsx("strong",{children:l.pending})]}),l.cancelled>0&&e.jsxs("span",{className:"text-red-500",children:["취소 ",e.jsx("strong",{children:l.cancelled})]})]})]},l.id))})]})]})}function de({programs:s,onReload:r}){const[c,d]=b.useState(null),[i,x]=b.useState(!1),h=async t=>{if(confirm(`"${t.name}" 강좌를 삭제하시겠습니까?`))try{await C.remove(t.id),m.success("삭제되었습니다"),r()}catch{m.error("삭제 실패")}},l=async()=>{d(null),x(!1),await r()};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"bg-white rounded-xl border p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"text-[13px] text-gray-500",children:["전체 ",e.jsx("strong",{className:"text-gray-800",children:s.length}),"개 강좌"]}),e.jsxs("button",{onClick:()=>x(!0),className:"flex items-center gap-1.5 px-4 py-2 bg-[#2C5F8A] text-white rounded-lg text-[13px] font-medium hover:bg-[#1E4060] shadow-sm transition-colors",children:[e.jsx(J,{className:"w-4 h-4"}),"강좌 추가"]})]})}),s.length===0?e.jsxs("div",{className:"bg-white rounded-xl border text-center py-16 text-gray-400 text-[13px]",children:[e.jsx(y,{className:"w-10 h-10 mx-auto mb-3 text-gray-300"}),"등록된 강좌가 없습니다"]}):e.jsx("div",{className:"bg-white rounded-xl border overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-200 bg-gray-50/80",children:[e.jsx("th",{className:"px-4 py-3 text-left text-[12px] font-semibold text-gray-600 min-w-[200px]",children:"강좌명"}),e.jsx("th",{className:"px-4 py-3 text-center text-[12px] font-semibold text-gray-600 min-w-[100px]",children:"카테고리"}),e.jsx("th",{className:"px-4 py-3 text-left text-[12px] font-semibold text-gray-600 min-w-[120px]",children:"강사"}),e.jsx("th",{className:"px-4 py-3 text-left text-[12px] font-semibold text-gray-600 min-w-[160px]",children:"강의시간"}),e.jsx("th",{className:"px-4 py-3 text-left text-[12px] font-semibold text-gray-600 min-w-[100px]",children:"장소"}),e.jsx("th",{className:"px-4 py-3 text-center text-[12px] font-semibold text-gray-600 min-w-[80px]",children:"수강료"}),e.jsx("th",{className:"px-4 py-3 text-center text-[12px] font-semibold text-gray-600 min-w-[70px]",children:"상태"}),e.jsx("th",{className:"px-4 py-3 text-center text-[12px] font-semibold text-gray-600 w-[140px]",children:"액션"})]})}),e.jsx("tbody",{children:s.map((t,n)=>e.jsxs("tr",{className:`border-b border-gray-100 hover:bg-blue-50/30 transition-colors ${n%2===1?"bg-gray-50/30":""}`,children:[e.jsxs("td",{className:"px-4 py-3.5",children:[e.jsx("div",{className:"text-[13px] font-semibold text-gray-900",children:t.name}),t.tagline&&e.jsx("div",{className:"text-[11px] text-gray-400 mt-0.5",children:t.tagline})]}),e.jsx("td",{className:"px-4 py-3.5 text-center",children:e.jsx("span",{className:`inline-block px-2 py-1 rounded-md text-[11px] font-semibold ${t.category==="sunday"?"bg-blue-100 text-blue-700":(t.category==="thursday","bg-slate-100 text-slate-700")}`,children:E[t.category]||t.category})}),e.jsxs("td",{className:"px-4 py-3.5",children:[e.jsx("div",{className:"text-[13px] text-gray-800",children:t.instructor}),t.instructorTitle&&!t.instructor.includes(t.instructorTitle)&&e.jsx("div",{className:"text-[11px] text-gray-400",children:t.instructorTitle})]}),e.jsx("td",{className:"px-4 py-3.5 text-[12px] text-gray-600 whitespace-pre-line leading-relaxed",children:t.scheduleText||"-"}),e.jsx("td",{className:"px-4 py-3.5 text-[12px] text-gray-600",children:t.location||"-"}),e.jsx("td",{className:"px-4 py-3.5 text-center text-[13px] font-medium text-gray-700",children:t.fee||"-"}),e.jsx("td",{className:"px-4 py-3.5 text-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("span",{className:`inline-block px-2 py-1 rounded-md text-[11px] font-semibold ${_(t.status)}`,children:D[t.status]}),t.recruitmentClosed&&e.jsx("span",{className:"inline-block px-2 py-0.5 rounded-md text-[10px] font-semibold bg-red-100 text-red-600",children:"모집마감"})]})}),e.jsx("td",{className:"px-4 py-3.5 text-center",children:e.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[e.jsx("button",{onClick:()=>d(t),className:"px-3 py-1.5 bg-[#2C5F8A] text-white rounded-md text-[11px] font-medium hover:bg-[#1E4060] transition-colors",children:"수정"}),e.jsx("button",{onClick:()=>h(t),className:"px-3 py-1.5 bg-red-500 text-white rounded-md text-[11px] font-medium hover:bg-red-600 transition-colors",children:"삭제"})]})})]},t.id))})]})})}),c&&e.jsx(F,{program:c,onClose:()=>d(null),onSave:l}),i&&e.jsx(F,{program:null,onClose:()=>x(!1),onSave:l})]})}function F({program:s,onClose:r,onSave:c}
1){const d=!!s,[i,x]=b.useState(!1),[h,l]=b.useState(!1),[t,n]=b.useState({name:(s==null?void 0:s.name)||"",description:(s==null?void 0:s.description)||"",instructor:(s==null?void 0:s.instructor)||"",instructorTitle:(s==null?void 0:s.instructorTitle)||"목사",scheduleText:(s==null?void 0:s.scheduleText)||"",location:(s==null?void 0:s.location)||"",fee:(s==null?void 0:s.fee)||"",target:(s==null?void 0:s.target)||"교인 누구나",category:(s==null?void 0:s.category)||"sunday",status:(s==null?void 0:s.status)||"active",recruitmentClosed:(s==null?void 0:s.recruitmentClosed)||!1,sortOrder:(s==null?void 0:s.sortOrder)||1,tagline:(s==null?void 0:s.tagline)||"",note:(s==null?void 0:s.note)||"",enrollment:(s==null?void 0:s.enrollment)||"사무실 신청",imageUrl:(s==null?void 0:s.imageUrl)||""}),o=async a=>{var U;const g=(U=a.target.files)==null?void 0:U[0];if(g){if(g.size>5*1024*1024){m.error("5MB 이하만 가능합니다");return}try{l(!0);const q=Date.now(),Y=g.name.split(".").pop()||"jpg",O=se(ne,`academy/courses/${q}.${Y}`);await ae(O,g,{contentType:g.type});const z=await le(O);n(G=>({...G,imageUrl:z})),m.success("이미지가 업로드되었습니다")}catch{m.error("업로드에 실패했습니다")}finally{l(!1)}}},j=async()=>{var a;if(!t.name.trim()){m.error("강좌명을 입력하세요");return}if(!t.instructor.trim()){m.error("강사를 입력하세요");return}if(!((a=t.scheduleText)!=null&&a.trim())){m.error("강의시간을 입력하세요");return}x(!0);try{d&&s?(await C.update(s.id,t),m.success("수정되었습니다")):(await C.create(t),m.success("추가되었습니다")),c()}catch{m.error("저장 실패")}finally{x(!1)}},u="w-full border rounded-lg px-3 py-2 text-[13px] focus:border-[#2C5F8A] focus:ring-1 focus:ring-[#2C5F8A]/20 outline-none";return e.jsx("div",{className:"fixed inset-0 bg-black/40 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white rounded-xl w-full max-w-lg max-h-[90vh] overflow-y-auto shadow-xl",onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between p-5 border-b bg-slate-50",children:[e.jsxs("h2",{className:"text-[15px] font-bold text-gray-900 flex items-center gap-2",children:[e.jsx(y,{className:"w-4 h-4 text-blue-600"}),d?"강좌 수정":"새 강좌 추가"]}),e.jsx("button",{onClick:r,className:"p-1 text-gray-400 hover:text-gray-600",children:e.jsx(P,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"p-5 space-y-3.5",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:["강좌명 ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{value:t.name,onChange:a=>n({...t,name:a.target.value}),className:u,placeholder:"예: 1세기 문화로 보는 바울서신(8주)"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"대표 이미지"}),e.jsxs("div",{className:"flex items-center gap-3",children:[t.imageUrl?e.jsxs("div",{className:"relative group",children:[e.jsx("img",{src:t.imageUrl,alt:"강좌 대표 이미지",className:"w-24 h-16 rounded-lg object-cover border"}),e.jsx("button",{type:"button",onClick:()=>n(a=>({...a,imageUrl:""})),className:"absolute -top-1.5 -right-1.5 w-5 h-5 bg-red-500 text-white rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(P,{className:"w-3 h-3"})})]}):e.jsx("div",{className:"w-24 h-16 rounded-lg border-2 border-dashed border-gray-300 flex items-center justify-center bg-gray-50",children:e.jsx(W,{className:"w-5 h-5 text-gray-300"})}),e.jsxs("label",{className:"flex items-center gap-1.5 px-3 py-2 bg-gray-100 border border-gray-200 rounded-lg hover:bg-gray-200 cursor-pointer text-[12px] font-medium text-gray-600 transition-colors",children:[e.jsx(Z,{className:"w-3.5 h-3.5"}),h?"업로드 중...":"이미지 선택",e.jsx("input",{type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:h})]})]}),e.jsx("p",{className:"text-[11px] text-gray-400 mt-1",children:"홈페이지 강좌 카드에 표시됩니다 (5MB 이하)"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"카테고리"}),e.jsx("select",{value:t.category,onChange:a=>n({...t,category:a.target.value}),className:u,children:Object.entries(E).map(([a,g])=>e.jsx("option",{value:a,children:g},a))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"상태"}),e.jsx("select",{value:t.status,onChange:a=>n({...t,status:a.target.value}),className:u,children:Object.entries(D).map(([a,g])=>e.jsx("option",{value:a,children:g},a))})]})]}),e.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer px-3 py-2.5 rounded-lg border hover:bg-red-50/50 transition-colors",style:{borderColor:t.recruitmentClosed?"#ef4444":"#e5e7eb"},children:[e.jsx("input",{type:"checkbox",checked:t.recruitmentClosed,onChange:a=>n({...t,recruitmentClosed:a.target.checked}),className:"w-4 h-4 accent-red-500 rounded cursor-pointer"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[13px] font-semibold text-gray-700",children:"모집마감"}),e.jsx("p",{className:"text-[11px] text-gray-400 mt-0.5",children:"체크하면 수강신청이 차단되고 '모집마감' 배지가 표시됩니다"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:["강사 ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{value:t.instructor,onChange:a=>n({...t,instructor:a.target.value}),className:u,placeholder:"이동근 목사"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"직함"}),e.jsx("input",{value:t.instructorTitle,onChange:a=>n({...t,instructorTitle:a.target.value}),className:u,placeholder:"목사"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:["강의시간 ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("textarea",{value:t.scheduleText,onChange:a=>n({...t,scheduleText:a.target.value}),className:u,rows:3,placeholder:`예:
2매주 주일 오후 3시
3개강: 3월 15일(주일)`}),e.jsx("p",{className:"text-[11px] text-gray-400 mt-0.5",children:"홈페이지 수강안내에 그대로 표시됩니다"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"장소"}),e.jsx("textarea",{value:t.location,onChange:a=>n({...t,location:a.target.value}),className:u,rows:2,placeholder:"고등부실"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"수강료"}),e.jsx("input",{value:t.fee,onChange:a=>n({...t,fee:a.target.value}),className:u,placeholder:"1만원"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"대상"}
3),e.jsx("input",{value:t.target,onChange:a=>n({...t,target:a.target.value}),className:u,placeholder:"교인 누구나"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"신청방법"}),e.jsx("input",{value:t.enrollment,onChange:a=>n({...t,enrollment:a.target.value}),className:u,placeholder:"사무실 신청"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"한줄소개"}),e.jsx("input",{value:t.tagline,onChange:a=>n({...t,tagline:a.target.value}),className:u,placeholder:"바울의 세계를 만나다"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"설명"}),e.jsx("textarea",{value:t.description,onChange:a=>n({...t,description:a.target.value}),className:u,rows:2,placeholder:"강좌 상세 설명"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"비고"}),e.jsx("textarea",{value:t.note,onChange:a=>n({...t,note:a.target.value}),className:u,rows:2,placeholder:"기타 안내사항"})]}),e.jsxs("div",{className:"w-24",children:[e.jsx("label",{className:"block text-[12px] font-semibold text-gray-700 mb-1",children:"정렬순서"}),e.jsx("input",{type:"number",value:t.sortOrder,onChange:a=>n({...t,sortOrder:Number(a.target.value)}),className:u,min:1})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 p-5 border-t bg-gray-50 rounded-b-xl",children:[e.jsx("button",{onClick:r,className:"px-4 py-2 text-[13px] text-gray-600 border rounded-lg hover:bg-gray-100",children:"취소"}),e.jsx("button",{onClick:j,disabled:i,className:"px-5 py-2 text-[13px] font-medium text-white bg-[#2C5F8A] rounded-lg hover:bg-[#1E4060] disabled:opacity-50 shadow-sm",children:i?"저장 중...":d?"수정 저장":"추가"})]})]})})}function ie({programs:s,enrollments:r,onReload:c}){const[d,i]=b.useState("all"),x=d==="all"?r:r.filter(t=>t.programId===d),h=async(t,n)=>{try{await T.updateStatus(t.id,n),m.success("상태가 변경되었습니다"),c()}catch{m.error("상태 변경 실패")}},l=async t=>{if(confirm(`${t.name}님의 신청을 삭제하시겠습니까?`))try{await T.remove(t.id),m.success("삭제되었습니다"),c()}catch{m.error("삭제 실패")}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"bg-white rounded-xl border p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("label",{className:"text-[12px] font-semibold text-gray-600",children:"강좌 필터:"}),e.jsxs("select",{value:d,onChange:t=>i(t.target.value),className:"border rounded-lg px-3 py-2 text-[13px] focus:border-[#2C5F8A] outline-none",children:[e.jsxs("option",{value:"all",children:["전체 (",r.length,"건)"]}),s.map(t=>{const n=r.filter(o=>o.programId===t.id).length;return e.jsxs("option",{value:t.id,children:[t.name," (",n,"건)"]},t.id)})]})]}),e.jsxs("div",{className:"text-[13px] text-gray-500",children:["조회 결과: ",e.jsx("strong",{className:"text-gray-800",children:x.length}),"건"]})]})}),x.length===0?e.jsxs("div",{className:"bg-white rounded-xl border text-center py-16 text-gray-400 text-[13px]",children:[e.jsx(I,{className:"w-10 h-10 mx-auto mb-3 text-gray-300"}),"수강신청 내역이 없습니다"]}):e.jsx("div",{className:"bg-white rounded-xl border overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-200 bg-gray-50/80",children:[e.jsx("th",{className:"px-4 py-3 text-left text-[12px] font-semibold text-gray-600",children:"강좌"}),e.jsxs("th",{className:"px-4 py-3 text-left text-[12px] font-semibold text-gray-600",children:[e.jsx(Q,{className:"w-3 h-3 inline mr-1"}),"이름"]}),e.jsxs("th",{className:"px-4 py-3 text-left text-[12px] font-semibold text-gray-600",children:[e.jsx(V,{className:"w-3 h-3 inline mr-1"}),"연락처"]}),e.jsx("th",{className:"px-4 py-3 text-center text-[12px] font-semibold text-gray-600",children:"교인"}),e.jsx("th",{className:"px-4 py-3 text-left text-[12px] font-semibold text-gray-600",children:"메모"}),e.jsx("th",{className:"px-4 py-3 text-center text-[12px] font-semibold text-gray-600",children:"상태"}),e.jsx("th",{className:"px-4 py-3 text-center text-[12px] font-semibold text-gray-600",children:"신청일"}),e.jsx("th",{className:"px-4 py-3 text-center text-[12px] font-semibold text-gray-600 w-[80px]",children:"액션"})]})}),e.jsx("tbody",{children:x.map((t,n)=>e.jsxs("tr",{className:`border-b border-gray-100 hover:bg-blue-50/30 transition-colors ${n%2===1?"bg-gray-50/30":""}`,children:[e.jsx("td",{className:"px-4 py-3 text-[13px] text-gray-700 max-w-[180px] truncate",children:t.programName}),e.jsx("td",{className:"px-4 py-3 text-[13px] font-semibold text-gray-900",children:t.name}),e.jsx("td",{className:"px-4 py-3 text-[13px] text-gray-600",children:t.phone}),e.jsx("td",{className:"px-4 py-3 text-center",children:t.isMember?e.jsx("span",{className:"inline-block px-2 py-0.5 bg-green-100 text-green-700 rounded-md text-[11px] font-medium",children:"교인"}):e.jsx("span",{className:"inline-block px-2 py-0.5 bg-gray-100 text-gray-500 rounded-md text-[11px] font-medium",children:"외부"})}),e.jsx("td",{className:"px-4 py-3 text-[12px] text-gray-500 max-w-[150px] truncate",children:t.note||"-"}),e.jsx("td",{className:"px-4 py-3 text-center",children:e.jsx("select",{value:t.status,onChange:o=>h(t,o.target.value),className:`text-[12px] border rounded-md px-2 py-1 font-medium ${t.status==="confirmed"?"text-green-700 bg-green-50 border-green-200":t.status==="cancelled"?"text-red-700 bg-red-50 border-red-200":"text-amber-700 bg-amber-50 border-amber-200"}`,children:Object.entries(re).map(([o,j])=>e.jsx("option",{value:o,children:j},o))})}),e.jsx("td",{className:"px-4 py-3 text-center text-gray-400 text-[12px]",children:t.createdAt?new Date(t.createdAt).toLocaleDateString("ko-KR"):"-"}),e.jsx("td",{className:"px-4 py-3 text-center",children:e.jsx("button",{onClick:()=>l(t),className:"px-3 py-1.5 bg-red-500 text-white rounded-md text-[11px] font-medium hover:bg-red-600 transition-colors",children:"삭제"})})]},t.id))})]})})})]})}export{ge as AcademyManagementPage};

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.