@premieroctet/next-admin
Version:
Next-Admin provides a customizable and turnkey admin dashboard for applications built with Next.js and powered by the Prisma ORM. It aims to simplify the development process by providing a turnkey admin system that can be easily integrated into your proje
21 lines (20 loc) • 590 B
JavaScript
"use client";
import { useEffect } from "react";
import { useConfig } from "../context/ConfigContext.mjs";
import { useRouterInternal } from "../hooks/useRouterInternal.mjs";
const Dashboard = ({ resources })=>{
const { basePath } = useConfig();
const { router } = useRouterInternal();
useEffect(()=>{
router.replace({
pathname: `${basePath}/${resources[0].toLowerCase()}`
});
}, [
router,
basePath,
resources
]);
return null;
};
const components_Dashboard = Dashboard;
export { components_Dashboard as default };