diff --git a/src/app/layout.tsx b/src/app/layout.tsx index f7fa87e..4c8f0b3 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,20 +1,12 @@ import type { Metadata } from "next"; -import { Geist, Geist_Mono } from "next/font/google"; import "./globals.css"; -const geistSans = Geist({ - variable: "--font-geist-sans", - subsets: ["latin"], -}); - -const geistMono = Geist_Mono({ - variable: "--font-geist-mono", - subsets: ["latin"], -}); - export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", + title: "cchcode - AI 智能助手", + description: "基于 Claude 的智能对话助手", + icons: { + icon: "/favicon.ico", + }, }; export default function RootLayout({ @@ -23,10 +15,8 @@ export default function RootLayout({ children: React.ReactNode; }>) { return ( - - + + {children} diff --git a/src/app/page.tsx b/src/app/page.tsx index 295f8fd..cf9bd4c 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,65 +1,70 @@ -import Image from "next/image"; +'use client'; + +import { useState } from 'react'; +import { useRouter } from 'next/navigation'; +import { AppLayout } from '@/components/layout/AppLayout'; +import { Welcome } from '@/components/features/Welcome'; +import { ChatInput } from '@/components/features/ChatInput'; +import { QuickActions } from '@/components/features/QuickActions'; +import { models, tools as initialTools, quickActions, currentUser, getGreeting } from '@/data/mock'; +import type { Model, Tool, QuickAction } from '@/types'; + +export default function HomePage() { + const router = useRouter(); + const [selectedModel, setSelectedModel] = useState(models[1]); // Sonnet as default + const [tools, setTools] = useState(initialTools); + + const greeting = getGreeting(currentUser.name); + + const handleToolToggle = (toolId: string) => { + setTools((prev) => + prev.map((tool) => + tool.id === toolId ? { ...tool, enabled: !tool.enabled } : tool + ) + ); + }; + + const handleEnableAllTools = (enabled: boolean) => { + setTools((prev) => + prev.map((tool) => ({ ...tool, enabled })) + ); + }; + + const handleSend = (message: string) => { + // 在实际应用中,这里会创建新对话并跳转 + console.log('Sending message:', message); + router.push('/chat/1'); + }; + + const handleQuickAction = (action: QuickAction) => { + if (action.prompt) { + handleSend(action.prompt); + } + }; -export default function Home() { return ( -
-
- Next.js logo +
+ {/* 欢迎区域 */} + + + {/* 聊天输入框 */} + -
-

- To get started, edit the page.tsx file. -

-

- Looking for a starting point or more instructions? Head over to{" "} - - Templates - {" "} - or the{" "} - - Learning - {" "} - center. -

-
- -
-
+ + {/* 快捷操作 */} + + + ); }