"use strict";exports.id=61779,exports.ids=[61779],exports.modules={61779:(a,b,c)=>{c.r(b),c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(42947),g=c(82697);c(92038),c(91115);let h={GENERAL:"Notice",EVENT:"Event",HOLIDAY:"Holiday"},i={GENERAL:"bg-slate-100 text-slate-700",EVENT:"bg-sky-50 text-sky-800",HOLIDAY:"bg-violet-50 text-violet-800"};function j(){let[a,b]=(0,e.useState)([]),[c,j]=(0,e.useState)(!0),[k,l]=(0,e.useState)(null);return(0,d.jsx)(f.o,{title:"Notices",description:"School announcements, events, and holidays for you.",children:c?(0,d.jsx)("div",{className:"space-y-3 animate-pulse",children:Array.from({length:3}).map((a,b)=>(0,d.jsx)("div",{className:"h-24 rounded-lg bg-slate-100"},b))}):0===a.length?(0,d.jsx)(g.i0,{title:"No notices yet",description:"When your school publishes announcements for you, they will show up here."}):(0,d.jsx)("ul",{className:"space-y-3",children:a.map(a=>{let b=k===a.id;return(0,d.jsx)("li",{children:(0,d.jsxs)("div",{className:"overflow-hidden rounded-lg border border-slate-100 bg-white shadow-sm",children:[(0,d.jsxs)("button",{type:"button",className:"w-full p-4 text-left touch-manipulation sm:p-5",onClick:()=>l(b?null:a.id),children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"mb-1.5 flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${i[a.noticeType]||i.GENERAL}`,children:h[a.noticeType]||"Notice"}),a.isPinned?(0,d.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-amber-700",children:"Pinned"}):null]}),(0,d.jsx)("p",{className:"font-semibold text-slate-900",children:a.title}),(0,d.jsxs)("p",{className:"mt-1 text-xs text-slate-500",children:[a.eventDate?`${a.eventDate} \xb7 `:"",a.publishAt?new Date(a.publishAt).toLocaleDateString():""]})]}),(0,d.jsx)("span",{className:"shrink-0 text-xs font-medium text-primary-700",children:b?"Hide":"Read"})]}),b?null:(0,d.jsx)("p",{className:"mt-2 line-clamp-2 text-sm text-slate-500",children:a.body})]}),b?(0,d.jsx)("div",{className:"border-t border-slate-100 px-4 py-3 text-sm whitespace-pre-wrap text-slate-800 sm:px-5",children:a.body}):null]})},a.id)})})})}}};