refactor(private-zone): use canonical product name
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { notFound } from "next/navigation";
|
||||
|
||||
import { getCharacterBySlug } from "@/data/constants/character";
|
||||
import { PrivateZoneRouteProvider } from "@/providers/private-zone-route-provider";
|
||||
|
||||
export default async function CharacterPrivateZoneLayout({
|
||||
children,
|
||||
params,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
params: Promise<{ characterSlug: string }>;
|
||||
}) {
|
||||
const { characterSlug } = await params;
|
||||
const character = getCharacterBySlug(characterSlug);
|
||||
if (!character?.capabilities.privateZone) notFound();
|
||||
|
||||
return (
|
||||
<PrivateZoneRouteProvider characterId={character.id}>
|
||||
{children}
|
||||
</PrivateZoneRouteProvider>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user