PageSourceSearch

https://asiacoach-zs7dipvk.manus.space/assets/CertificatePage-BrZr9iFX.js

js asiacoach-zs7dipvk.manus.space collected 2026-10-03 05:00:31 UTC 14,500 bytes, 1 lines download raw bytes

1import{b as m,j as e}from"./react-core-vendor-BYU1lc6_.js";import{u as Q,t as i,C as s,B as r}from"./index-tz1if3Qb.js";import{B as U}from"./badge-BXHeVMDm.js";import{L as _}from"./router-vendor-C6WQLFPl.js";import{t as o}from"./react-dom-vendor-DP7iwX5j.js";import{D as M,a as q,b as $,c as z}from"./dialog-DLHI93Z9.js";import{I as O}from"./input-D3THlcXi.js";import{L as R}from"./label-FSycdNgc.js";import{x as T,F as H,w as y,ap as v,g as p,u as j,Y,M as b}from"./icons-vendor-2DcWnZLX.js";import"./ui-vendor-Ca4nMe5D.js";import"./charts-vendor-Sd7wU2Xd.js";const N={pending_payment:{label:"입금 대기",icon:v,color:"text-yellow-500"},pending_approval:{label:"승인 대기",icon:j,color:"text-blue-500"},issued:{label:"발급 완료",icon:y,color:"text-green-500"},rejected:{label:"반려",icon:j,color:"text-red-500"}};function ce(){const{user:w,isAuthenticated:l}=Q({redirectOnUnauthenticated:!0}),{data:g,isLoading:I}=i.certificates.myCertificates.useQuery(void 0,{enabled:l}),{data:D}=i.enrollments.myEnrollments.useQuery(void 0,{enabled:l}),{data:A}=i.exams.myAttempts.useQuery(void 0,{enabled:l}),k=i.useUtils(),[f,d]=m.useState(null),[n,x]=m.useState(""),[E,u]=m.useState(!1),F=async()=>{if(!(!n||!f)){u(!0);try{o.success(`${n} 주소로 자격증 PDF 링크를 발송했습니다.`),d(null),x("")}catch{o.error("이메일 발송에 실패했습니다.")}finally{u(!1)}}},h=i.certificates.request.useMutation({onSuccess:t=>{o.success(`자격증 발급 신청이 완료되었습니다. (${t.certificateNumber})`),k.certificates.myCertificates.invalidate()},onError:t=>{o.error(t.message||"신청에 실패했습니다.")}});if(!l)return null;const S=(D??[]).filter(t=>t.status==="completed"),C=(A??[]).filter(t=>t.passed),B=new Set((g??[]).map(t=>t.courseId)),P=S.filter(t=>{const a=C.some(L=>L.enrollmentId===t.id),c=B.has(t.courseId);return a&&!c});return e.jsx("div",{"data-loc":"client/src/pages/CertificatePage.tsx:71",className:"min-h-screen bg-background",children:e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:72",className:"max-w-4xl mx-auto p-6",children:[e.jsxs(_,{"data-loc":"client/src/pages/CertificatePage.tsx:73",href:"/dashboard",className:"flex items-center gap-2 text-primary hover:text-primary/80 mb-6",children:[e.jsx(T,{"data-loc":"client/src/pages/CertificatePage.tsx:74",className:"w-4 h-4"})," 대시보드로 돌아가기"]}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:77",className:"space-y-8",children:[e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:78",children:[e.jsx("h1",{"data-loc":"client/src/pages/CertificatePage.tsx:79",className:"text-3xl font-bold text-foreground mb-2",children:"자격증 발급"}),e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:80",className:"text-muted-foreground",children:"과정 수료 및 시험 합격 후 자격증을 발급받을 수 있습니다."})]}),e.jsxs(s,{"data-loc":"client/src/pages/CertificatePage.tsx:84",className:"p-8 bg-card border border-border",children:[e.jsx("h2",{"data-loc":"client/src/pages/CertificatePage.tsx:85",className:"font-bold mb-6",children:"발급 프로세스"}),e.jsx("div",{"data-loc":"client/src/pages/CertificatePage.tsx:86",className:"grid md:grid-cols-4 gap-4",children:[{step:1,title:"과정 수료",desc:"교육 과정을 모두 이수합니다.",icon:H},{step:2,title:"시험 합격",desc:"온라인 필기시험에 합격합니다.",icon:y},{step:3,title:"발급비 입금",desc:"무통장 입금으로 발급비를 납부합니다.",icon:v},{step:4,title:"자격증 발급",desc:"관리자 승인 후 PDF 다운로드",icon:p}].map(t=>e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:93",className:"text-center space-y-2",children:[e.jsx("div",{"data-loc":"client/src/pages/CertificatePage.tsx:94",className:"w-12 h-12 rounded-full bg-secondary/10 flex items-center justify-center mx-auto",children:e.jsx(t.icon,{"data-loc":"client/src/pages/CertificatePage.tsx:95",className:"w-6 h-6 text-secondary"})}),e.jsxs("p",{"data-loc":"client/src/pages/CertificatePage.tsx:97",className:"text-xs text-secondary font-medium",children:["STEP ",t.step]}),e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:98",className:"font-semibold text-sm text-foreground",children:t.title}),e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:99",className:"text-xs text-muted-foreground",children:t.desc})]},t.step))})]}),P.length>0&&e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:107",className:"mb-8",children:[e.jsx("h2",{"data-loc":"client/src/pages/CertificatePage.tsx:108",className:"font-bold mb-4 text-foreground",children:"발급 가능한 자격증"}),e.jsx("div",{"data-loc":"client/src/pages/CertificatePage.tsx:109",className:"space-y-4",children:P.map(t=>{const a=C.find(c=>c.enrollmentId===t.id);return e.jsxs(s,{"data-loc":"client/src/pages/CertificatePage.tsx:113",className:"p-5 flex items-center justify-between bg-card border border-border",children:[e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:114",className:"flex items-center gap-4",children:[e.jsx("div",{"data-loc":"client/src/pages/CertificatePage.tsx:115",className:"w-10 h-10 rounded-lg bg-green-500/10 flex items-center justify-center",children:e.jsx(p,{"data-loc":"client/src/pages/CertificatePage.tsx:116",className:"w-5 h-5 text-green-500"})}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:118",children:[e.jsxs("p",{"data-loc":"client/src/pages/CertificatePage.tsx:119",className:"font-semibold text-foreground",children:["과정 #",t.courseId," 자격증"]}),e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:120",className:"text-xs text-muted-foreground",children:"수료 완료 · 시험 합격"})]})]}),e.jsx(r,{"data-loc":"client/src/pages/CertificatePage.tsx:123",className:"bg-primary text-primary-foreground hover:bg-primary/90",onClick:()=>h.mutate({courseId:t.courseId,enrollmentId:t.id,examAttemptId:a?.id}),disabled:h.isPending,children:"발급 신청"})]},t.id)})})]}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:142",children:[e.jsx("h2",{"data-loc":"client/src/pages/CertificatePage.tsx:143",className:"font-bold mb-4 text-foreground",children:"내 자격증 현황"}),I?e.jsx("div",{"data-loc":"client/src/pages/CertificatePage.tsx:145",className:"space-y-4",children:[1,2].map(t=>e.jsx(s,{"data-loc":"client/src/pages/CertificatePage.tsx:145",className:"p-4 animate-pulse h-20 bg-card border border-border"},t))}):(g??[]).length===0?e.jsxs(s,{"data-loc":"client/src/pages/CertificatePage.tsx:147",className:"p-12 text-center bg-card border border-border",children:[e.jsx(p,{"data-loc":"client/src/pages/CertificatePage.tsx:148",className:"w-12 h-12 mx-auto text-muted-foreground
1/50 mb-4"}),e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:149",className:"text-muted-foreground",children:"발급 신청한 자격증이 없습니다."}),e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:150",className:"text-xs text-muted-foreground mt-2",children:"과정 수료 및 시험 합격 후 발급 신청이 가능합니다."})]}):e.jsx("div",{"data-loc":"client/src/pages/CertificatePage.tsx:153",className:"space-y-4",children:(g??[]).map(t=>{const a=N[t.status]||N.pending_payment,c=a.icon;return e.jsxs(s,{"data-loc":"client/src/pages/CertificatePage.tsx:158",className:"p-5 bg-card border border-border",children:[e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:159",className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:160",className:"flex items-center gap-4",children:[e.jsx("div",{"data-loc":"client/src/pages/CertificatePage.tsx:161",className:"w-10 h-10 rounded-lg bg-secondary/10 flex items-center justify-center",children:e.jsx(c,{"data-loc":"client/src/pages/CertificatePage.tsx:162",className:`w-5 h-5 ${a.color}`})}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:164",children:[e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:165",className:"font-semibold font-mono text-foreground",children:t.certificateNumber}),e.jsxs("p",{"data-loc":"client/src/pages/CertificatePage.tsx:166",className:"text-xs text-muted-foreground",children:["과정 #",t.courseId]})]})]}),e.jsx(U,{"data-loc":"client/src/pages/CertificatePage.tsx:169",variant:t.status==="issued"?"default":"secondary",children:a.label})]}),t.status==="pending_payment"&&e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:176",className:"mt-4 p-4 bg-secondary/5 rounded-lg border border-secondary/20",children:[e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:177",className:"text-sm font-semibold text-foreground mb-3",children:"무통장 입금 안내"}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:178",className:"space-y-2 text-sm text-muted-foreground",children:[e.jsxs("p",{"data-loc":"client/src/pages/CertificatePage.tsx:179",children:[e.jsx("span",{"data-loc":"client/src/pages/CertificatePage.tsx:179",className:"font-semibold text-foreground",children:"입금 계좌:"})," 국민은행 123-456-789"]}),e.jsxs("p",{"data-loc":"client/src/pages/CertificatePage.tsx:180",children:[e.jsx("span",{"data-loc":"client/src/pages/CertificatePage.tsx:180",className:"font-semibold text-foreground",children:"예금주:"})," 아시아코치센터"]}),e.jsxs("p",{"data-loc":"client/src/pages/CertificatePage.tsx:181",children:[e.jsx("span",{"data-loc":"client/src/pages/CertificatePage.tsx:181",className:"font-semibold text-foreground",children:"입금액:"})," 50,000원"]}),e.jsxs("p",{"data-loc":"client/src/pages/CertificatePage.tsx:182",children:[e.jsx("span",{"data-loc":"client/src/pages/CertificatePage.tsx:182",className:"font-semibold text-foreground",children:"입금 후:"})," 관리자 확인 후 자격증이 발급됩니다."]})]})]}),t.status==="pending_approval"&&e.jsx("div",{"data-loc":"client/src/pages/CertificatePage.tsx:189",className:"mt-4 p-4 bg-blue-50 rounded-lg border border-blue-200",children:e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:190",className:"text-sm text-blue-800",children:"입금이 확인되었습니다. 관리자의 승인을 기다려주세요."})}),t.status==="issued"&&t.pdfUrl&&e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:196",className:"mt-4 flex gap-2 flex-wrap",children:[e.jsx(r,{"data-loc":"client/src/pages/CertificatePage.tsx:197",size:"sm",variant:"outline",className:"border-primary text-primary hover:bg-primary/10",asChild:!0,children:e.jsxs("a",{"data-loc":"client/src/pages/CertificatePage.tsx:198",href:t.pdfUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(Y,{"data-loc":"client/src/pages/CertificatePage.tsx:199",className:"w-4 h-4 mr-1"})," PDF 다운로드"]})}),e.jsxs(r,{"data-loc":"client/src/pages/CertificatePage.tsx:202",size:"sm",variant:"outline",className:"border-yellow-500 text-yellow-700 hover:bg-yellow-50",onClick:()=>{d({certId:t.id,pdfUrl:t.pdfUrl}),x(w?.email||"")},children:[e.jsx(b,{"data-loc":"client/src/pages/CertificatePage.tsx:208",className:"w-4 h-4 mr-1"})," 이메일로 받기"]})]})]},t.id)})})]}),e.jsx(M,{"data-loc":"client/src/pages/CertificatePage.tsx:220",open:!!f,onOpenChange:t=>!t&&d(null),children:e.jsxs(q,{"data-loc":"client/src/pages/CertificatePage.tsx:221",className:"sm:max-w-sm",children:[e.jsx($,{"data-loc":"client/src/pages/CertificatePage.tsx:222",children:e.jsx(z,{"data-loc":"client/src/pages/CertificatePage.tsx:223",children:"자격증 PDF 이메일 발송"})}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:225",className:"space-y-4 py-2",children:[e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:226",className:"text-sm text-gray-500",children:"자격증 PDF 링크를 이메일로 발송합니다."}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:227",children:[e.jsx(R,{"data-loc":"client/src/pages/CertificatePage.tsx:228",htmlFor:"cert-email",children:"이메일 주소"}),e.jsx(O,{"data-loc":"client/src/pages/CertificatePage.tsx:229",id:"cert-email",type:"email",value:n,onChange:t=>x(t.target.value),placeholder:"[email protected]"})]}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:237",className:"flex gap-2",children:[e.jsx(r,{"data-loc":"client/src/pages/CertificatePage.tsx:238",variant:"outline",className:"flex-1",onClick:()=>d(null),children:"취소"}),e.jsxs(r,{"data-loc":"client/src/pages/CertificatePage.tsx:239",className:"flex-1 bg-yellow-500 hover:bg-yellow-600 text-white",onClick:F,disabled:E||!n,children:[e.jsx(b,{"data-loc":"client/src/pages/CertificatePage.tsx:244",className:"w-4 h-4 mr-2"})," 발송하기"]})]})]})]})}),e.jsxs(s,{"data-loc":"client/src/pages/CertificatePage.tsx:252",className:"p-6 bg-card border border-border",children:[e.jsx("h3",{"data-loc":"client/src/pages/CertificatePage.tsx:253",className:"font-bold mb-4 text-foreground",children:"자주 묻는 질문"}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:254",className:"space-y-4 text-sm",children:[e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:255",children:[e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:256",className:"font-semibold text-foreground mb-1",children:"Q. 자격증 발급비는 얼마인가요?"}),e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:257",className:"text-muted-foreground",children:"A. 자격증 발급비는 50,000원입니다."})]}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:259",children:[e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:260",className:"font-semibold text-foreground mb-1",children:"Q. 입금 후 얼마나 걸려서 자격증을 받을 수 있나요?"}),e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:261",className:"text-muted-foreground",children:"A. 입금 확인 후 1-2일 이내에 관리자가 승인하여 자격증을 발급해드립니다."})]}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:263",children:[e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:264",className:"font-semibold text-foreground mb-1",children:"Q. 자격증을 다시 발급받을 수 있나요?"}),e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:265",className:"text-muted-foreground",children:"A. 발급 후 PDF 파일ì
1„ 보관하시고, 필요시 관리자에게 문의하여 재발급 받으실 수 있습니다."})]})]})]})]})]})})}export{ce 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.