/** * Here is default redirect to `origin` pathname on hard page reload. *

Updated: now, the current parallel route will write to specific (`customization_source`) search parameter of the origin route. * To correct handling it, we need to put them to the client component for manage routing via App Router. * You can see the flow of this process by opening returned component.

*/ import type { PageProps, ParallelModalSearchParams } from "@/core/types/common"; import { permanentRedirect } from "next/navigation"; import CustomizationRedirect from "@/app/(visualization)/project/customization/_components/CustomizationRedirect"; type Params = { catchAll: string[] }; export default function Default(props: PageProps>>): JSX.Element | never { if (props.searchParams.modal) { const sourceSearchParams = new URLSearchParams(props.searchParams as Record); sourceSearchParams.delete("perspective"); const source = decodeURIComponent(props.searchParams.modal) + "?" + sourceSearchParams.toString(); const redirectSearchParams = new URLSearchParams({ customization_source: source }); const redirectRoute = decodeURIComponent(props.searchParams.origin) + "?" + redirectSearchParams.toString(); return ; } return permanentRedirect(decodeURIComponent(props.searchParams.origin)); }