mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-05-03 18:50:43 +08:00
30 lines
643 B
TypeScript
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>
|
|
);
|
|
}
|