Files
deer-flow/web/src/app/_components/theme-provider-wrapper.tsx
2025-04-28 11:44:13 +08:00

30 lines
643 B
TypeScript

// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
"use client";
import { usePathname } from "next/navigation";
import { ThemeProvider } from "~/components/theme-provider";
export function ThemeProviderWrapper({
children,
}: {
children: React.ReactNode;
}) {
const pathname = usePathname();
const isChatPage = pathname?.startsWith("/chat");
return (
<ThemeProvider
attribute="class"
defaultTheme={"dark"}
enableSystem={isChatPage}
forcedTheme={isChatPage ? undefined : "dark"}
disableTransitionOnChange
>
{children}
</ThemeProvider>
);
}