22 lines
616 B
TypeScript
22 lines
616 B
TypeScript
"use client";
|
|
import * as React from "react";
|
|
import { HeroUIProvider } from "@heroui/system";
|
|
import { useRouter } from 'next/navigation'
|
|
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
|
import { ThemeProviderProps } from "next-themes/dist/types";
|
|
|
|
export interface ProvidersProps {
|
|
children: React.ReactNode;
|
|
themeProps?: ThemeProviderProps;
|
|
}
|
|
|
|
export function Providers({ children, themeProps }: ProvidersProps) {
|
|
const router = useRouter();
|
|
|
|
return (
|
|
<HeroUIProvider navigate={router.push}>
|
|
<NextThemesProvider {...themeProps}>{children}</NextThemesProvider>
|
|
</HeroUIProvider>
|
|
);
|
|
}
|