"use strict";(()=>{var e={};e.id=8883,e.ids=[8883],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")},98569:(e,t,n)=>{n.r(t),n.d(t,{GlobalError:()=>o.a,__next_app__:()=>m,originalPathname:()=>p,pages:()=>c,routeModule:()=>u,tree:()=>d}),n(11547),n(23891),n(32029),n(35866);var s=n(23191),a=n(88716),r=n(37922),o=n.n(r),i=n(95231),l={};for(let e in i)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>i[e]);n.d(t,l);let d=["",{children:["student",{children:["list",{children:["announcements",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(n.bind(n,11547)),"C:\\School Management System\\Working\\V2\\src\\app\\student\\list\\announcements\\page.tsx"]}]},{}]},{}]},{layout:[()=>Promise.resolve().then(n.bind(n,23891)),"C:\\School Management System\\Working\\V2\\src\\app\\student\\layout.tsx"],metadata:{icon:[async e=>(await Promise.resolve().then(n.bind(n,73881))).default(e)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(n.bind(n,32029)),"C:\\School Management System\\Working\\V2\\src\\app\\layout.tsx"],"not-found":[()=>Promise.resolve().then(n.t.bind(n,35866,23)),"next/dist/client/components/not-found-error"],metadata:{icon:[async e=>(await Promise.resolve().then(n.bind(n,73881))).default(e)],apple:[],openGraph:[],twitter:[],manifest:void 0}}],c=["C:\\School Management System\\Working\\V2\\src\\app\\student\\list\\announcements\\page.tsx"],p="/student/list/announcements/page",m={require:n,loadChunk:()=>Promise.resolve()},u=new s.AppPageRouteModule({definition:{kind:a.x.APP_PAGE,page:"/student/list/announcements/page",pathname:"/student/list/announcements",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},11547:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var s=n(19510),a=n(54654),r=n(97379),o=n(39664),i=n(13538),l=n(93247),d=n(78459);let c=async({searchParams:e})=>{let{userId:t}=(0,d.I)(),{page:n,...c}=e,p=n?parseInt(n):1,m=await i.Z.student.findUnique({where:{id:t}}),u={OR:[{classId:null},{classId:m?.classId}]};c.search&&(u.title={contains:c.search});let[x,h]=await i.Z.$transaction([i.Z.announcement.findMany({where:u,include:{class:!0},take:l.B,skip:l.B*(p-1),orderBy:{date:"desc"}}),i.Z.announcement.count({where:u})]);return(0,s.jsxs)("div",{className:"bg-white p-4 rounded-md flex-1 m-4 mt-0 min-h-screen",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h1",{className:"hidden md:block text-lg font-semibold",children:"Announcements"}),s.jsx(o.ZP,{})]}),s.jsx(r.Z,{columns:[{header:"Title",accessor:"title"},{header:"Category",accessor:"class",className:"hidden md:table-cell"},{header:"Date",accessor:"date",className:"hidden md:table-cell"}],renderRow:e=>(0,s.jsxs)("tr",{className:"border-b border-gray-200 even:bg-slate-50 text-sm hover:bg-gray-50",children:[(0,s.jsxs)("td",{className:"p-4",children:[s.jsx("h4",{className:"font-bold text-gray-800",children:e.title}),s.jsx("p",{className:"text-xs text-gray-500 md:hidden",children:new Date(e.date).toLocaleDateString()})]}),s.jsx("td",{className:"hidden md:table-cell",children:e.class?s.jsx("span",{className:"bg-purple-100 text-purple-700 px-2 py-1 rounded text-xs font-bold",children:e.class.name}):s.jsx("span",{className:"bg-green-100 text-green-700 px-2 py-1 rounded text-xs font-bold",children:"General"})}),s.jsx("td",{className:"hidden md:table-cell text-gray-500",children:new Intl.DateTimeFormat("en-US").format(e.date)})]},e.id),data:x}),s.jsx(a.ZP,{page:p,count:h})]})}}};var t=require("../../../../webpack-runtime.js");t.C(e);var n=e=>t(t.s=e),s=t.X(0,[8948,7070,8459,3706,4079,9404,2082,7343,9651,7924,2067],()=>n(98569));module.exports=s})();