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