diff --git a/nazara/apps/web/app/layout.tsx b/nazara/apps/web/app/layout.tsx index 4f58953..bf98b1a 100644 --- a/nazara/apps/web/app/layout.tsx +++ b/nazara/apps/web/app/layout.tsx @@ -45,7 +45,7 @@ export default function RootLayout({ {!hasEnvVars ? : } -
+
{children}
diff --git a/nazara/apps/web/lib/realtime.tsx b/nazara/apps/web/lib/realtime.tsx new file mode 100644 index 0000000..9d7e6bb --- /dev/null +++ b/nazara/apps/web/lib/realtime.tsx @@ -0,0 +1,14 @@ +'use client'; + +export default function + + useEffect(() => { + const daysChannel = supabase.channel('days') + .on('postgres_changes', { event: 'UPDATE', schema: 'public', table: 'days' }, (payload) => { + setDay(payload.new); + }).subscribe(); + + return () => { + daysChannel.unsubscribe(); + } + }, [supabase]) \ No newline at end of file