Improve page load times and rendering
This commit is contained in:
@@ -1,28 +1,12 @@
|
||||
"use client";
|
||||
|
||||
import dynamic from "next/dynamic";
|
||||
import type { ReactNode } from "react";
|
||||
import { useTranslation } from "../../contexts/MessagesContext";
|
||||
|
||||
function CreateFlowLayoutLoading() {
|
||||
const t = useTranslation("controlsChrome");
|
||||
return (
|
||||
<div
|
||||
className="flex h-screen min-h-0 flex-col overflow-hidden bg-black"
|
||||
aria-busy="true"
|
||||
aria-label={t("loadingCreateFlow")}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const CreateFlowLayoutClient = dynamic(
|
||||
() => import("./CreateFlowLayoutClient"),
|
||||
{
|
||||
ssr: false,
|
||||
loading: () => <CreateFlowLayoutLoading />,
|
||||
},
|
||||
);
|
||||
import CreateFlowLayoutClient from "./CreateFlowLayoutClient";
|
||||
|
||||
/**
|
||||
* Server-renders the create-flow chrome shell so users see real layout instead
|
||||
* of a black `aria-busy` div while the client bundle hydrates. The provider
|
||||
* inside `CreateFlowLayoutClient` defers `localStorage` reads to a mount-once
|
||||
* effect so SSR + first client render align.
|
||||
*/
|
||||
export default function CreateFlowLayoutGate({
|
||||
children,
|
||||
}: {
|
||||
|
||||
Reference in New Issue
Block a user