import { eq } from "drizzle-orm"; import { notFound } from "next/navigation"; import { db } from "@/lib/db"; import { tvstarSession } from "@/lib/db/schema"; export const dynamic = "force-dynamic"; type SharedSnapshot = { title: string; goal: string; createdAt: number; messages: { role: "user" | "assistant"; content: string; createdAt: number }[]; plan: { summary: string; deliverables: string[] } | null; shots: { shot: string; duration: string; sceneDescription: string }[]; }; export default async function TVstarSharedConversation({ params }: { params: Promise<{ token: string }> }) { const { token } = await params; if (!/^[A-Za-z0-9_-]{32}$/.test(token || "")) notFound(); const row = (await db.select({ snapshot: tvstarSession.sharedSnapshot }).from(tvstarSession) .where(eq(tvstarSession.shareToken, token)).limit(1))[0]; if (!row?.snapshot) notFound(); const shared = row.snapshot as SharedSnapshot; return

TVstar · 只读分享

{shared.title}

{new Date(shared.createdAt).toLocaleString("zh-CN")}

{shared.goal}

{(shared.messages || []).map((message, index) =>

{message.role === "user" ? "用户" : "TVstar"}

{message.content}

)}
{shared.plan ?

创作规划

{shared.plan.summary}

: null} {shared.shots?.length ?

分镜

    {shared.shots.map((shot, index) =>
  1. {shot.shot} · {shot.duration}

    {shot.sceneDescription}

  2. )}
: null}

此页面是分享时的对话快照,无法编辑画布;对话正文中的文字和链接会原样显示。

; }