diff --git a/app/canvas/[id]/layout.tsx b/app/canvas/[id]/layout.tsx
index 193132a..c7ce48b 100644
--- a/app/canvas/[id]/layout.tsx
+++ b/app/canvas/[id]/layout.tsx
@@ -1,9 +1,5 @@
import { Metadata } from "next";
import { Suspense } from "react";
-import { cookies } from "next/headers";
-import { auth } from "@/app/(auth)/auth";
-import { TopNavbar } from "@/components/top-navbar";
-import { getSiteSettings, getNavLinks, getTutorialVideos } from "@/lib/db/queries";
export const metadata: Metadata = {
title: "无限画布",
@@ -17,51 +13,7 @@ export default function CanvasEditorLayout({
}) {
return (
}>
- {children}
+
{children}
);
}
-
-async function CanvasLayoutWrapper({ children }: { children: React.ReactNode }) {
- const [session, siteSettings, navLinks, tutorialVideos] = await Promise.all([
- auth(),
- getSiteSettings(),
- getNavLinks(),
- getTutorialVideos(),
- ]);
-
- return (
-
-
({
- id: link.id,
- name: link.name,
- url: link.url,
- order: link.order,
- toolboxGroup: link.toolboxGroup || 1,
- }))}
- toolbox1Name={siteSettings.toolbox1Name || "工具箱"}
- toolbox1Enabled={siteSettings.toolbox1Enabled ?? true}
- toolbox2Name={siteSettings.toolbox2Name || "工具箱2"}
- toolbox2Enabled={siteSettings.toolbox2Enabled ?? false}
- tutorialVideos={tutorialVideos.map(v => ({
- id: v.id,
- title: v.title,
- videoUrl: v.videoUrl,
- coverUrl: v.coverUrl,
- description: v.description,
- order: v.order,
- }))}
- tutorialEnabled={siteSettings.tutorialEnabled ?? false}
- rankingEnabled={siteSettings.rankingEnabled ?? true}
- />
-
- {children}
-
-
- );
-}
diff --git a/app/canvas/[id]/page.tsx b/app/canvas/[id]/page.tsx
index 1d05b88..2901db3 100644
--- a/app/canvas/[id]/page.tsx
+++ b/app/canvas/[id]/page.tsx
@@ -2,6 +2,7 @@
import { useEffect, useState, useCallback, use } from "react";
import { useRouter, useParams } from "next/navigation";
+import useSWR from "swr";
import {
ArrowLeft,
Save,
@@ -65,7 +66,7 @@ import { CanvasChatPanel } from "@/components/canvas/CanvasChatPanel";
import { CanvasFileListPanel } from "@/components/canvas/CanvasFileListPanel";
import { ObjectPickerOverlay } from "@/components/canvas/ObjectPickerOverlay";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
-import { cn } from "@/lib/utils";
+import { cn, fetcher } from "@/lib/utils";
import { MessageSquare, FolderOpen, Grid2X2 } from "lucide-react";
interface PageProps {
@@ -122,6 +123,12 @@ export default function CanvasEditorPage({ params }: PageProps) {
const [isPanelOpen, setIsPanelOpen] = useState(true);
// 面板模式: 'chat' 聊天面板, 'fileList' 文件列表
const [panelMode, setPanelMode] = useState<'chat' | 'fileList'>('chat');
+
+ const { data: siteSettingsData } = useSWR<{
+ siteName?: string;
+ siteLogo?: string | null;
+ siteLogoDark?: string | null;
+ }>("/api/site-settings", fetcher);
// 生成配置
const [prompt, setPrompt] = useState("");
@@ -572,6 +579,33 @@ export default function CanvasEditorPage({ params }: PageProps) {
{/* 5. Floating Bottom Toolbar (Left) */}
+
+
+
+
+ 返回首页
+
+
+
+
{/* Tools: Select, Pan, Add Text, Add Image, Add Video */}