mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
feat: dynamically import video presentation tool to optimize bundle size
This commit is contained in:
parent
25b068f420
commit
f17a0edf86
1 changed files with 10 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ import {
|
|||
useAui,
|
||||
useAuiState,
|
||||
} from "@assistant-ui/react";
|
||||
import dynamic from "next/dynamic";
|
||||
import { useAtomValue } from "jotai";
|
||||
import {
|
||||
CheckIcon,
|
||||
|
|
@ -76,12 +77,20 @@ import {
|
|||
resolveSafeNavigationHref,
|
||||
} from "@/components/tool-ui/shared/media";
|
||||
import { RecallMemoryToolUI, SaveMemoryToolUI } from "@/components/tool-ui/user-memory";
|
||||
import { GenerateVideoPresentationToolUI } from "@/components/tool-ui/video-presentation";
|
||||
import { Drawer, DrawerContent, DrawerHandle, DrawerHeader, DrawerTitle } from "@/components/ui/drawer";
|
||||
import { useComments } from "@/hooks/use-comments";
|
||||
import { useMediaQuery } from "@/hooks/use-media-query";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
// Dynamically import video presentation tool to avoid loading Babel and Remotion in main bundle
|
||||
const GenerateVideoPresentationToolUI = dynamic(
|
||||
() =>
|
||||
import("@/components/tool-ui/video-presentation").then((m) => ({
|
||||
default: m.GenerateVideoPresentationToolUI,
|
||||
})),
|
||||
{ ssr: false }
|
||||
);
|
||||
|
||||
function extractDomain(url: string): string | undefined {
|
||||
try {
|
||||
return new URL(url).hostname.replace(/^www\./, "");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue