perf: lazy load video presentation in public chat

Convert GenerateVideoPresentationToolUI from static import to dynamic import
with ssr: false in public-thread.tsx. This prevents Remotion and @babel/standalone
from being bundled in the public chat page.

The main app's assistant-message.tsx already correctly lazy-loads this component,
but the public thread was still using a static import, unnecessarily increasing
the bundle size for public shared chats.

Benefits:
- Removes Remotion and @babel/standalone from public chat bundle
- Reduces initial bundle size for public shared chats
- Video presentations still render correctly when present
- Faster page load for users viewing public chats

Fixes #1145
This commit is contained in:
SohamBhattacharjee2003 2026-04-08 06:32:05 +05:30
parent e404b05b11
commit ac554974f6

View file

@ -8,6 +8,7 @@ import {
useAuiState,
} from "@assistant-ui/react";
import { CheckIcon, CopyIcon } from "lucide-react";
import dynamic from "next/dynamic";
import Image from "next/image";
import { type FC, type ReactNode, useState } from "react";
import { CitationMetadataProvider } from "@/components/assistant-ui/citation-metadata-context";
@ -17,7 +18,11 @@ import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button
import { GenerateImageToolUI } from "@/components/tool-ui/generate-image";
import { GeneratePodcastToolUI } from "@/components/tool-ui/generate-podcast";
import { GenerateReportToolUI } from "@/components/tool-ui/generate-report";
import { GenerateVideoPresentationToolUI } from "@/components/tool-ui/video-presentation";
const GenerateVideoPresentationToolUI = dynamic(
() => import("@/components/tool-ui/video-presentation").then((m) => ({ default: m.GenerateVideoPresentationToolUI })),
{ ssr: false }
);
interface PublicThreadProps {
footer?: ReactNode;