适配x9
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import AIPage from "@/pages/AIPage";
|
||||
import { lazy, Suspense } from "react";
|
||||
import PageLoader from "@/components/PageLoader";
|
||||
import { useAIDrawer } from "@/contexts/AIDrawerContext";
|
||||
import { useIsLgUp } from "@/hooks/useIsLgUp";
|
||||
import { cn } from "@/lib/utils";
|
||||
@@ -11,6 +12,8 @@ import {
|
||||
type RefObject,
|
||||
} from "react";
|
||||
|
||||
const AIPage = lazy(() => import("@/pages/AIPage"));
|
||||
|
||||
function SplitDivider({
|
||||
containerRef,
|
||||
onResize,
|
||||
@@ -114,7 +117,9 @@ export default function DesktopAIShell({ children }: { children: ReactNode }) {
|
||||
className="flex h-full min-h-0 min-w-0 flex-col overflow-hidden border-l border-white/[0.08] bg-[#0d1117]"
|
||||
style={{ flex: `${splitPercent} 1 0%` }}
|
||||
>
|
||||
<AIPage variant="split" onClose={() => setOpen(false)} />
|
||||
<Suspense fallback={<PageLoader />}>
|
||||
<AIPage variant="split" onClose={() => setOpen(false)} />
|
||||
</Suspense>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/** Lightweight fallback while lazy-loaded routes fetch their chunks. */
|
||||
export default function PageLoader() {
|
||||
return (
|
||||
<div className="flex min-h-[40vh] items-center justify-center">
|
||||
<span className="text-sm text-white/40">Loading…</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user