💩 create hero UI wrapper

still need fix or downgrade tailwind to v3
This commit is contained in:
2025-07-09 09:58:01 +07:00
parent 5266010976
commit 28d81d9792
8 changed files with 458 additions and 7 deletions

View File

@ -0,0 +1,31 @@
"use client";
import React, { useEffect, useState } from "react";
import { HeroUIProvider } from "@heroui/react";
import { ThemeProvider as NextThemesProvider } from "next-themes";
import { useRouter } from "next/navigation";
const HeroUIWrapper = ({
children,
}: Readonly<{ children: React.ReactNode }>) => {
const [mounted, setMounted] = useState(false);
useEffect(() => {
setMounted(true);
}, []);
const router = useRouter();
return (
<HeroUIProvider navigate={router.push}>
{mounted ? (
<NextThemesProvider attribute={"class"} defaultTheme="dark">
<main>{children}</main>
</NextThemesProvider>
) : (
<main className="dark text-foreground bg-background"></main>
)}
</HeroUIProvider>
);
};
export default HeroUIWrapper;