"use strict";(()=>{var e={};e.id=1370,e.ids=[1370],e.modules={53524:e=>{e.exports=require("@prisma/client")},47849:e=>{e.exports=require("next/dist/client/components/action-async-storage.external")},72934:e=>{e.exports=require("next/dist/client/components/action-async-storage.external.js")},55403:e=>{e.exports=require("next/dist/client/components/request-async-storage.external")},54580:e=>{e.exports=require("next/dist/client/components/request-async-storage.external.js")},94749:e=>{e.exports=require("next/dist/client/components/static-generation-async-storage.external")},45869:e=>{e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},6113:e=>{e.exports=require("crypto")},92761:e=>{e.exports=require("node:async_hooks")},6005:e=>{e.exports=require("node:crypto")},71017:e=>{e.exports=require("path")},57310:e=>{e.exports=require("url")},24044:(e,t,s)=>{s.r(t),s.d(t,{GlobalError:()=>o.a,__next_app__:()=>u,originalPathname:()=>p,pages:()=>d,routeModule:()=>m,tree:()=>c}),s(44535),s(23891),s(32029),s(35866);var r=s(23191),a=s(88716),n=s(37922),o=s.n(n),i=s(95231),l={};for(let e in i)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>i[e]);s.d(t,l);let c=["",{children:["student",{children:["list",{children:["subjects",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(s.bind(s,44535)),"C:\\School Management System\\Working\\V2\\src\\app\\student\\list\\subjects\\page.tsx"]}]},{}]},{}]},{layout:[()=>Promise.resolve().then(s.bind(s,23891)),"C:\\School Management System\\Working\\V2\\src\\app\\student\\layout.tsx"],metadata:{icon:[async e=>(await Promise.resolve().then(s.bind(s,73881))).default(e)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(s.bind(s,32029)),"C:\\School Management System\\Working\\V2\\src\\app\\layout.tsx"],"not-found":[()=>Promise.resolve().then(s.t.bind(s,35866,23)),"next/dist/client/components/not-found-error"],metadata:{icon:[async e=>(await Promise.resolve().then(s.bind(s,73881))).default(e)],apple:[],openGraph:[],twitter:[],manifest:void 0}}],d=["C:\\School Management System\\Working\\V2\\src\\app\\student\\list\\subjects\\page.tsx"],p="/student/list/subjects/page",u={require:s,loadChunk:()=>Promise.resolve()},m=new r.AppPageRouteModule({definition:{kind:a.x.APP_PAGE,page:"/student/list/subjects/page",pathname:"/student/list/subjects",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:c}})},44535:(e,t,s)=>{s.r(t),s.d(t,{default:()=>d});var r=s(19510),a=s(54654),n=s(97379),o=s(39664),i=s(13538),l=s(93247),c=s(78459);let d=async({searchParams:e})=>{let{userId:t}=(0,c.I)(),s=await i.Z.student.findUnique({where:{id:t},select:{classId:!0}});if(!s?.classId)return r.jsx("div",{className:"p-6",children:"You are not assigned to any class."});let{page:d,...p}=e,u=d?parseInt(d):1,m={lessons:{some:{classId:s.classId}}};p.search&&(m.name={contains:p.search});let[x,h]=await i.Z.$transaction([i.Z.subject.findMany({where:m,include:{teachers:!0},take:l.B,skip:l.B*(u-1)}),i.Z.subject.count({where:m})]);return(0,r.jsxs)("div",{className:"bg-white p-4 rounded-md flex-1 m-4 mt-0",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[r.jsx("h1",{className:"hidden md:block text-lg font-semibold",children:"My Subjects"}),r.jsx("div",{className:"flex flex-col md:flex-row items-center gap-4 w-full md:w-auto",children:r.jsx(o.ZP,{})})]}),r.jsx(n.Z,{columns:[{header:"Subject Name",accessor:"name"},{header:"Teachers",accessor:"teachers",className:"hidden md:table-cell"}],renderRow:e=>(0,r.jsxs)("tr",{className:"border-b border-gray-200 last:border-none text-sm hover:bg-gray-50",children:[r.jsx("td",{className:"flex items-center gap-4 p-4",children:r.jsx("div",{className:"flex flex-col",children:r.jsx("h3",{className:"font-semibold",children:e.name})})}),r.jsx("td",{className:"hidden md:table-cell",children:e.teachers.map(e=>e.name+" "+e.surname).join(", ")})]},e.id),data:x}),r.jsx(a.ZP,{page:u,count:h})]})}}};var t=require("../../../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),r=t.X(0,[8948,7070,8459,3706,4079,9404,2082,7343,9651,7924,2067],()=>s(24044));module.exports=r})();