Files
new-api-analytics/components/ClientProviders.tsx
shangzy 1b5977a420 feat: add hidden /portal page for SinoCode iframe embedding
Full-screen landing page with glassmorphism cards linking to monitoring
(8018), docs (8017), and analytics (8019). Sidebar is conditionally
hidden on the portal route. Supports dark/light themes and i18n.
2026-04-02 19:30:32 +08:00

28 lines
699 B
TypeScript

"use client";
import { type ReactNode } from "react";
import { usePathname } from "next/navigation";
import { I18nProvider } from "@/lib/i18n";
import { ThemeProvider } from "@/lib/theme";
import { Sidebar } from "@/components/Sidebar";
export function ClientProviders({ children }: { children: ReactNode }) {
const pathname = usePathname();
const isPortal = pathname === "/portal";
return (
<ThemeProvider>
<I18nProvider>
{isPortal ? (
<>{children}</>
) : (
<>
<Sidebar />
<main className="ml-[220px] min-h-screen p-6 lg:p-8">{children}</main>
</>
)}
</I18nProvider>
</ThemeProvider>
);
}