Files
frontend/apps/sn/app/(popupLayout)/popup/[popupKey]/page.tsx
T

34 lines
947 B
TypeScript

import { isWindowPopupKey } from "@/features/windowPopup/model/popupDefinitions";
import WindowPopupRenderer from "@/features/windowPopup/ui/WindowPopupRenderer";
type PopupPageProps = {
params: Promise<{
popupKey: string;
}>;
searchParams: Promise<Record<string, string | string[] | undefined>>;
};
export default async function PopupPage({
params,
searchParams,
}: PopupPageProps) {
const { popupKey } = await params;
const resolvedSearchParams = await searchParams;
if (!isWindowPopupKey(popupKey)) {
return (
<section className="flex min-h-dvh flex-col items-center justify-center gap-4 p-8 text-center">
<h1 className="text-2xl font-semibold">등록되지 않은 팝업입니다.</h1>
<p className="text-base text-label">popupKey: {popupKey}</p>
</section>
);
}
return (
<WindowPopupRenderer
popupKey={popupKey}
searchParams={resolvedSearchParams}
/>
);
}