web-humas-fe/app/providers.tsx

22 lines
616 B
TypeScript
Raw Normal View History

2024-01-05 06:57:30 +00:00
"use client";
import * as React from "react";
2025-02-13 09:15:38 +00:00
import { HeroUIProvider } from "@heroui/system";
2024-01-05 06:57:30 +00:00
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) {
2024-02-19 08:39:35 +00:00
const router = useRouter();
2024-01-05 06:57:30 +00:00
return (
2025-02-13 09:15:38 +00:00
<HeroUIProvider navigate={router.push}>
2024-01-05 06:57:30 +00:00
<NextThemesProvider {...themeProps}>{children}</NextThemesProvider>
2025-02-13 09:15:38 +00:00
</HeroUIProvider>
2024-01-05 06:57:30 +00:00
);
}