"use client"; import { cn } from "@/lib/utils"; import { useResolvedWallpaper } from "@/modules/shell/hooks/useResolvedWallpaper"; import { type ReactNode, useEffect, useState } from "react"; type FullScreenShellProps = { center: ReactNode; bottom?: ReactNode; topRight?: ReactNode; wallpaper?: string; showClock?: boolean; centerClassName?: string; bottomClassName?: string; }; export function FullScreenShell({ center, bottom, topRight, wallpaper, showClock = true, centerClassName, bottomClassName, }: FullScreenShellProps) { const [now, setNow] = useState(null); const { wallpaper: storedWallpaper } = useResolvedWallpaper(); const resolvedWallpaper = wallpaper ?? storedWallpaper; useEffect(() => { setNow(new Date()); if (!showClock) return; const timer = window.setInterval(() => setNow(new Date()), 1000); return () => window.clearInterval(timer); }, [showClock]); return (
{topRight ? (
{topRight}
) : null}
{showClock ? (

{now ? now.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit", }) : "--:--"}

{now ? now.toLocaleDateString("en-US", { weekday: "long", month: "long", day: "numeric", year: "numeric", }) : "\u00a0"}

) : null}
{center}
{bottom ? (
{bottom}
) : null}
); }