import{_ as p}from"./Layout-C0f8t0-G.js";import{c as _,w as r,a as t,b as f,t as o,u as v,l as h,d as w,n as d,e as i,o as l,F as c,r as m}from"./app-iLLm8RtX.js";/* empty css            */const k={class:"py-6"},P={class:"max-w-7xl mx-auto sm:px-6 lg:px-8"},L={class:"bg-white shadow mb-6"},N={class:"px-6 py-4"},S={class:"flex justify-between items-center"},A={class:"text-gray-600"},R={class:"bg-white shadow mb-6"},B={class:"px-6 py-4"},C={class:"grid grid-cols-1 md:grid-cols-4 gap-4"},D={class:"text-lg font-semibold text-gray-900"},E={class:"text-lg font-semibold text-green-600"},j={class:"text-lg font-semibold text-red-600"},T={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},V={class:"bg-white shadow"},F={class:"p-6"},z={key:0,class:"text-center text-gray-500 py-8"},O={key:1,class:"space-y-4"},U={class:"flex justify-between items-start mb-2"},$={class:"font-semibold text-lg text-green-600"},q={class:"text-sm text-gray-600"},G={class:"text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded"},H={class:"text-sm text-gray-700 mb-2"},I={class:"text-xs text-gray-500"},J={class:"bg-white shadow"},K={class:"p-6"},M={key:0,class:"text-center text-gray-500 py-8"},Q={key:1,class:"space-y-4"},W={class:"flex justify-between items-start mb-2"},X={class:"font-semibold text-gray-900"},Y={class:"text-sm text-gray-600"},Z={class:"text-sm text-gray-700 mb-2"},tt={class:"text-xs text-gray-500"},nt={__name:"EnrollmentRecords",props:{enrollment:Object,paymentRecords:Array,activityLogs:Array},setup(a){const u=n=>{const e=n.amount_paid||0,s=n.course.price||0;return e>=s?"bg-green-100 text-green-800":e>0?"bg-blue-100 text-blue-800":"bg-yellow-100 text-yellow-800"},x=n=>{const e=n.amount_paid||0,s=n.course.price||0;return e>=s?"Paid":e>0?"Partial":"Pending"},y=n=>{switch(n){case"payment_added":return"bg-green-100 text-green-800";case"certificate_issued":return"bg-blue-100 text-blue-800";case"payment_status_updated":return"bg-yellow-100 text-yellow-800";default:return"bg-gray-100 text-gray-800"}},g=n=>n?new Date(n).toLocaleDateString():"N/A",b=n=>n?new Date(n).toLocaleString():"N/A";return(n,e)=>(l(),_(p,null,{default:r(()=>[t("div",k,[t("div",P,[t("div",L,[t("div",N,[t("div",S,[t("div",null,[e[0]||(e[0]=t("h1",{class:"text-2xl font-bold text-gray-900"},"Enrollment Records",-1)),t("p",A,o(a.enrollment.student.name)+" - "+o(a.enrollment.course.name),1)]),f(v(h),{href:"/admin/enrollments",class:"bg-gray-600 hover:bg-gray-700 text-white font-bold py-2 px-4 rounded"},{default:r(()=>[...e[1]||(e[1]=[w(" Back to Enrollments ",-1)])]),_:1})])])]),t("div",R,[t("div",B,[e[6]||(e[6]=t("h2",{class:"text-lg font-bold text-gray-900 mb-4"},"Enrollment Summary",-1)),t("div",C,[t("div",null,[e[2]||(e[2]=t("label",{class:"block text-sm font-medium text-gray-700"},"Course Price",-1)),t("p",D,"₦"+o(a.enrollment.course.price?.toLocaleString()),1)]),t("div",null,[e[3]||(e[3]=t("label",{class:"block text-sm font-medium text-gray-700"},"Amount Paid",-1)),t("p",E,"₦"+o(a.enrollment.amount_paid?.toLocaleString()||0),1)]),t("div",null,[e[4]||(e[4]=t("label",{class:"block text-sm font-medium text-gray-700"},"Remaining Balance",-1)),t("p",j,"₦"+o(((a.enrollment.course.price||0)-(a.enrollment.amount_paid||0)).toLocaleString()),1)]),t("div",null,[e[5]||(e[5]=t("label",{class:"block text-sm font-medium text-gray-700"},"Payment Status",-1)),t("span",{class:d([u(a.enrollment),"px-3 py-1 text-sm font-semibold rounded-full"])},o(x(a.enrollment)),3)])])])]),t("div",T,[t("div",V,[e[7]||(e[7]=t("div",{class:"px-6 py-4 border-b"},[t("h2",{class:"text-lg font-bold text-gray-900"},"Payment Records")],-1)),t("div",F,[a.paymentRecords.length===0?(l(),i("div",z," No payment records found ")):(l(),i("div",O,[(l(!0),i(c,null,m(a.paymentRecords,s=>(l(),i("div",{key:s.id,class:"border rounded-lg p-4"},[t("div",U,[t("div",null,[t("p",$,"₦"+o(s.amount?.toLocaleString()),1),t("p",q,o(g(s.payment_date)),1)]),t("span",G,o(s.payment_method||"N/A"),1)]),t("p",H,o(s.notes||"No notes"),1),t("p",I," Recorded by: "+o(s.recorded_by_name)+" ("+o(s.recorded_by_type)+") ",1)]))),128))]))])]),t("div",J,[e[8]||(e[8]=t("div",{class:"px-6 py-4 border-b"},[t("h2",{class:"text-lg font-bold text-gray-900"},"Activity Logs")],-1)),t("div",K,[a.activityLogs.length===0?(l(),i("div",M," No activity logs found ")):(l(),i("div",Q,[(l(!0),i(c,null,m(a.activityLogs,s=>(l(),i("div",{key:s.id,class:"border rounded-lg p-4"},[t("div",W,[t("div",null,[t("p",X,o(s.action.replace("_"," ").toUpperCase()),1),t("p",Y,o(b(s.created_at)),1)]),t("span",{class:d([y(s.action),"text-xs px-2 py-1 rounded"])},o(s.performed_by_type),3)]),t("p",Z,o(s.description),1),t("p",tt," By: "+o(s.performed_by_name),1)]))),128))]))])])])])])]),_:1}))}};export{nt as default};
