fix: load 3d viewers on client
This commit is contained in:
parent
edc3ae59b1
commit
82dda143eb
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import { formatDistanceToNow } from "date-fns";
|
import { formatDistanceToNow } from "date-fns";
|
||||||
import { zhCN } from "date-fns/locale";
|
import { zhCN } from "date-fns/locale";
|
||||||
|
import dynamic from "next/dynamic";
|
||||||
import {
|
import {
|
||||||
ArrowLeft,
|
ArrowLeft,
|
||||||
Bone,
|
Bone,
|
||||||
@ -49,10 +50,8 @@ import useSWR from "swr";
|
|||||||
import {
|
import {
|
||||||
type Model3DLayer,
|
type Model3DLayer,
|
||||||
type Model3DStats,
|
type Model3DStats,
|
||||||
Model3DViewer,
|
|
||||||
type Model3DViewerSettings,
|
type Model3DViewerSettings,
|
||||||
} from "@/components/canvas/model3d/Model3DViewer";
|
} from "@/components/canvas/model3d/Model3DViewer";
|
||||||
import { World3DViewer } from "@/components/canvas/world3d/World3DViewer";
|
|
||||||
import { Badge } from "@/components/ui/badge";
|
import { Badge } from "@/components/ui/badge";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import {
|
import {
|
||||||
@ -115,6 +114,36 @@ import {
|
|||||||
} from "@/services/canvas";
|
} from "@/services/canvas";
|
||||||
import { canvasSelectors, useCanvasStore } from "@/store/canvas";
|
import { canvasSelectors, useCanvasStore } from "@/store/canvas";
|
||||||
|
|
||||||
|
const Model3DViewer = dynamic(
|
||||||
|
() =>
|
||||||
|
import("@/components/canvas/model3d/Model3DViewer").then(
|
||||||
|
(module) => module.Model3DViewer
|
||||||
|
),
|
||||||
|
{
|
||||||
|
loading: () => (
|
||||||
|
<div className="flex h-full w-full items-center justify-center text-sm text-zinc-500">
|
||||||
|
准备加载 3D 视图...
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
ssr: false,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const World3DViewer = dynamic(
|
||||||
|
() =>
|
||||||
|
import("@/components/canvas/world3d/World3DViewer").then(
|
||||||
|
(module) => module.World3DViewer
|
||||||
|
),
|
||||||
|
{
|
||||||
|
loading: () => (
|
||||||
|
<div className="flex h-full w-full items-center justify-center text-sm text-zinc-500">
|
||||||
|
准备加载 World 视图...
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
ssr: false,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
type GenerationMode = "text" | "image" | "multiview" | "batch";
|
type GenerationMode = "text" | "image" | "multiview" | "batch";
|
||||||
type WorkspaceMode = "model" | "world";
|
type WorkspaceMode = "model" | "world";
|
||||||
type WorldGenerationMode = "text" | "image" | "multi-image" | "video";
|
type WorldGenerationMode = "text" | "image" | "multi-image" | "video";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user