Add client-side calendar event notification system that evaluates JMAP CalendarEventAlert triggers and displays toast notifications when alert times are reached. Includes configurable notification sound, acknowledged alert persistence, and proactive event fetching for background alerts. Also mounts ToastContainer globally to fix silent toast failures.
35 lines
920 B
TypeScript
35 lines
920 B
TypeScript
import { notFound } from "next/navigation";
|
|
import { IntlProvider } from "@/components/providers/intl-provider";
|
|
import { ThemeProvider } from "@/components/providers/theme-provider";
|
|
import { CalendarAlertProvider } from "@/components/providers/calendar-alert-provider";
|
|
import { locales } from "@/i18n/routing";
|
|
|
|
export default async function LocaleLayout({
|
|
children,
|
|
params,
|
|
}: {
|
|
children: React.ReactNode;
|
|
params: Promise<{ locale: string }>;
|
|
}) {
|
|
const { locale } = await params;
|
|
|
|
if (!(locales as readonly string[]).includes(locale)) notFound();
|
|
|
|
let messages;
|
|
try {
|
|
messages = (await import(`@/locales/${locale}/common.json`)).default;
|
|
} catch {
|
|
notFound();
|
|
}
|
|
|
|
return (
|
|
<IntlProvider locale={locale} messages={messages}>
|
|
<ThemeProvider>
|
|
<CalendarAlertProvider>
|
|
{children}
|
|
</CalendarAlertProvider>
|
|
</ThemeProvider>
|
|
</IntlProvider>
|
|
);
|
|
}
|