perf(vite): add dynamic imports
This commit is contained in:
parent
78e15f6218
commit
85921a0a08
29 changed files with 470 additions and 326 deletions
15
apps/web/src/components/callSidebarBox.tsx
Normal file
15
apps/web/src/components/callSidebarBox.tsx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { lazy, Suspense } from "react";
|
||||
|
||||
import { useCall } from "@tensamin/call/state";
|
||||
|
||||
const SidebarBox = lazy(() => import("@tensamin/call/sidebarBox"));
|
||||
|
||||
export default function CallSidebarBox() {
|
||||
const active = useCall((state) => state.state !== "closed");
|
||||
|
||||
return active ? (
|
||||
<Suspense fallback={null}>
|
||||
<SidebarBox />
|
||||
</Suspense>
|
||||
) : null;
|
||||
}
|
||||
Loading…
Reference in a new issue