Import source: src/app/(panel)/[...slug]/page
Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { notFound } from "next/navigation";
|
||||
import { FeaturePage } from "@/components/features/feature-page";
|
||||
import { routeItems } from "@/lib/routes";
|
||||
|
||||
export default async function PanelRoute({ params }: { params: Promise<{ slug?: string[] }> }) {
|
||||
const { slug = [] } = await params;
|
||||
const path = `/${slug.join("/")}`;
|
||||
const exact = routeItems.some((route) => route.path === path);
|
||||
const supportedDynamic =
|
||||
/^\/websites\/[^/]+(\/deployments|\/logs|\/settings)?$/.test(path) ||
|
||||
/^\/domains\/[^/]+(\/dns|\/ssl)?$/.test(path) ||
|
||||
/^\/servers\/[^/]+(\/services|\/processes|\/updates|\/network)?$/.test(path) ||
|
||||
/^\/backups\/[^/]+$/.test(path) ||
|
||||
/^\/automation\/[^/]+$/.test(path);
|
||||
if (!exact && !supportedDynamic) notFound();
|
||||
return <FeaturePage path={path} />;
|
||||
}
|
||||
Reference in New Issue
Block a user