qudoco-fe/app/(admin)/admin/content-website/page.tsx

41 lines
1.2 KiB
TypeScript
Raw Normal View History

2026-02-17 10:02:35 +00:00
"use client";
2026-02-27 08:52:08 +00:00
import Cookies from "js-cookie";
2026-02-17 10:02:35 +00:00
import ContentWebsite from "@/components/main/content-website";
2026-02-27 08:52:08 +00:00
2026-02-17 10:02:35 +00:00
import { motion } from "framer-motion";
import { useEffect, useState } from "react";
2026-02-27 08:52:08 +00:00
import ApproverContentWebsite from "@/components/main/content-website-approver";
2026-02-17 10:02:35 +00:00
export default function ContentWebsitePage() {
const [mounted, setMounted] = useState(false);
2026-02-27 08:52:08 +00:00
const [levelId, setLevelId] = useState<string | undefined>();
2026-02-17 10:02:35 +00:00
useEffect(() => {
setMounted(true);
2026-02-27 08:52:08 +00:00
const ulne = Cookies.get("ulne");
setLevelId(ulne);
2026-02-17 10:02:35 +00:00
}, []);
if (!mounted) {
return (
<div className="h-full overflow-auto bg-gradient-to-br from-slate-50/50 via-white to-slate-50/50 flex items-center justify-center">
<div className="animate-spin rounded-full h-32 w-32 border-b-2 border-blue-500"></div>
</div>
);
}
return (
<motion.div
className="h-full overflow-auto bg-gradient-to-br from-slate-50/50 via-white to-slate-50/50"
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ duration: 0.3 }}
>
<div className="p-6">
2026-02-27 08:52:08 +00:00
{levelId === "2" ? <ApproverContentWebsite /> : <ContentWebsite />}
2026-02-17 10:02:35 +00:00
</div>
</motion.div>
);
}