"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8235],{8235:(e,s,t)=>{t.r(s),t.d(s,{default:()=>o});var a=t(95155),l=t(12115),d=t(30571),i=t(30313),n=t(75560),r=t(2581);function o(){let[e,s]=(0,l.useState)([]),[t,o]=(0,l.useState)(!0);return(0,l.useEffect)(()=>{let e=!1;return(0,n.BJ)().then(t=>{e||s(t)}).catch(s=>{e||(0,r.Qg)(s instanceof Error?s.message:"Failed to load holidays")}).finally(()=>{e||o(!1)}),()=>{e=!0}},[]),(0,a.jsx)(d.o,{title:"Holidays",description:"Upcoming school holidays and closed days.",children:t?(0,a.jsx)("div",{className:"h-40 animate-pulse rounded-lg bg-slate-100"}):e.length?(0,a.jsx)("ul",{className:"divide-y divide-slate-100 overflow-hidden rounded-lg border border-slate-100 bg-white shadow-sm",children:e.map(e=>(0,a.jsx)("li",{className:"px-4 py-4 sm:px-5",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-semibold text-slate-900",children:e.title}),(0,a.jsx)("p",{className:"mt-1 text-sm tabular-nums text-slate-600",children:e.startDate===e.endDate?e.startDate:`${e.startDate} → ${e.endDate}`}),e.description?(0,a.jsx)("p",{className:"mt-1 text-sm text-slate-500",children:e.description}):null]}),(0,a.jsx)("span",{className:"rounded-md bg-slate-100 px-2 py-1 text-xs font-medium text-slate-600",children:e.holidayType})]})},e.id))}):(0,a.jsx)(i.i0,{title:"No upcoming holidays",description:"When the school adds holidays to the calendar, they will appear here."})})}}}]);