import { useEffect } from "react"; import { Outlet, useLocation } from "react-router"; import { ParticleBackground } from "@/components/particle-background"; import { Sidebar } from "@/components/sidebar"; import { useAuthStore } from "@/models/auth"; import { useInstanceStore } from "@/models/instance"; import { useSettingsStore } from "@/models/settings"; export function IndexPage() { const authStore = useAuthStore(); const settingsStore = useSettingsStore(); const instanceStore = useInstanceStore(); const location = useLocation(); useEffect(() => { authStore.init(); settingsStore.refresh(); instanceStore.refresh(); }, [authStore.init, settingsStore.refresh, instanceStore.refresh]); return (
{settingsStore.config?.customBackgroundPath && ( <> Background console.error("Failed to load main background:", e) } /> {/* Dimming Overlay for readability */}
)} {!settingsStore.config?.customBackgroundPath && ( <> {settingsStore.theme === "dark" ? (
) : (
)} {location.pathname === "/" && }
)} {/* Subtle Grid Overlay */}
); }