From dedc62cb79134bea141f9d023a0923f3871e9215 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 30 Apr 2026 00:22:17 +0800 Subject: [PATCH] perf: split classic chat from lovart home --- app/(chat)/page.tsx | 22 +++++++--------------- components/classic-chat-start.tsx | 31 +++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 15 deletions(-) create mode 100644 components/classic-chat-start.tsx diff --git a/app/(chat)/page.tsx b/app/(chat)/page.tsx index 3a643d47b..0c9e0f19e 100644 --- a/app/(chat)/page.tsx +++ b/app/(chat)/page.tsx @@ -1,8 +1,6 @@ import { cookies } from "next/headers"; import { redirect } from "next/navigation"; import { Suspense } from "react"; -import { Chat } from "@/components/chat"; -import { DataStreamHandler } from "@/components/data-stream-handler"; import { LovartHome } from "@/components/home/lovart-home"; import { generateUUID } from "@/lib/utils"; import { auth } from "../(auth)/auth"; @@ -146,19 +144,13 @@ async function NewChatPage() { } } + const { ClassicChatStart } = await import("@/components/classic-chat-start"); + return ( - <> - - - + ); } diff --git a/components/classic-chat-start.tsx b/components/classic-chat-start.tsx new file mode 100644 index 000000000..edd9da118 --- /dev/null +++ b/components/classic-chat-start.tsx @@ -0,0 +1,31 @@ +import type { UserType } from "@/app/(auth)/auth"; +import { Chat } from "@/components/chat"; +import { DataStreamHandler } from "@/components/data-stream-handler"; + +type ClassicChatStartProps = { + id: string; + initialModelId: string; + userType?: UserType; +}; + +export function ClassicChatStart({ + id, + initialModelId, + userType, +}: ClassicChatStartProps) { + return ( + <> + + + + ); +}