(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8290],{70586:function(e,s,t){Promise.resolve().then(t.bind(t,98903))},58064:function(e,s,t){"use strict";Object.defineProperty(s,"$",{enumerable:!0,get:function(){return a}});let r=t(74590);function a(e){let{createServerReference:s}=t(6671);return s(e,r.callServer)}},67669:function(e,s,t){"use strict";t.d(s,{h:function(){return c},i:function(){return a}}),t(74590);var r=t(58064),a=(0,r.$)("5c8f7f611bdec8b3c9e1156ccdf014bfbfbbafa7"),c=(0,r.$)("bef96225b573cb4c444345211c7471ed1c51344c")},98903:function(e,s,t){"use strict";t.d(s,{default:function(){return n}});var r=t(57437),a=t(2265),c=t(67669);function n(e){var s;let{students:t}=e,[n,l]=(0,a.useState)(""),[d,i]=(0,a.useState)(null),[x,o]=(0,a.useState)(!1),h=async()=>{if(n){o(!0);try{let e=await (0,c.i)(n);i(e)}catch(e){console.error(e)}finally{o(!1)}}};return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"border-b pb-4",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-gray-800",children:"Student Transcripts"}),(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"View performance reports."})]}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsxs)("select",{className:"flex-1 p-2 border rounded",value:n,onChange:e=>l(e.target.value),children:[(0,r.jsx)("option",{value:"",children:"Select Student"}),t.map(e=>(0,r.jsxs)("option",{value:e.id,children:[e.name," (",e.className,")"]},e.id))]}),(0,r.jsx)("button",{onClick:h,disabled:!n||x,className:"px-4 py-2 bg-school-green-600 text-white rounded hover:bg-school-green-500 disabled:opacity-50",children:x?"Loading...":"View Transcript"})]}),d&&(0,r.jsxs)("div",{className:"bg-white border rounded shadow-sm p-8 max-w-3xl mx-auto",children:[(0,r.jsxs)("div",{className:"text-center mb-8 border-b pb-4",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold text-gray-800",children:"Official Transcript"}),(0,r.jsxs)("p",{className:"text-gray-600",children:[d.year," Academic Year"]})]}),(0,r.jsxs)("div",{className:"flex justify-between mb-6 text-sm",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"block text-gray-500",children:"Student Name"}),(0,r.jsxs)("span",{className:"font-semibold",children:[d.student.name," ",d.student.surname]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"block text-gray-500",children:"Class"}),(0,r.jsx)("span",{className:"font-semibold",children:null===(s=d.student.class)||void 0===s?void 0:s.name})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"block text-gray-500",children:"Student ID"}),(0,r.jsx)("span",{className:"font-semibold",children:d.student.id})]})]}),0===Object.keys(d.transcript).length&&(0,r.jsx)("p",{className:"text-center text-gray-500 italic",children:"No results found for this year."}),Object.entries(d.transcript).map(e=>{let[s,t]=e;return(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsx)("h3",{className:"font-bold text-lg mb-2 text-school-green-700 border-b border-school-green-100 pb-1",children:s}),(0,r.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,r.jsx)("thead",{className:"bg-gray-50 text-gray-600",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"p-2",children:"Subject"}),(0,r.jsx)("th",{className:"p-2 text-right",children:"Max"}),(0,r.jsx)("th",{className:"p-2 text-right",children:"Score"}),(0,r.jsx)("th",{className:"p-2 text-center",children:"Grade"})]})}),(0,r.jsx)("tbody",{children:t.map((e,s)=>(0,r.jsxs)("tr",{className:"border-b last:border-0",children:[(0,r.jsx)("td",{className:"p-2 font-medium",children:e.subject}),(0,r.jsx)("td",{className:"p-2 text-right",children:e.max}),(0,r.jsx)("td",{className:"p-2 text-right font-bold",children:e.score}),(0,r.jsx)("td",{className:"p-2 text-center",children:(0,r.jsx)("span",{className:"px-2 py-1 rounded text-xs font-bold ".concat("F"===e.grade?"bg-red-100 text-red-700":"bg-green-100 text-green-700"),children:e.grade})})]},s))})]})]},s)})]})]})}}},function(e){e.O(0,[2971,7023,1744],function(){return e(e.s=70586)}),_N_E=e.O()}]);