Open History to see the last commit
1import type { OfficePreviewKind } from "@t3tools/shared/filePreview";
2import { lazy, Suspense } from "react";
3
4import { FileSurfaceLoading } from "./fileSurfaceChrome";
5
6const OfficeViewer = lazy(() => import("./OfficeViewer"));
7
8export function OfficeFilePreview(props: {
9 readonly src: string;
10 readonly name: string;
11 readonly kind: OfficePreviewKind;
12 readonly sizeBytes?: number;
13}) {
14 return (
15 <Suspense fallback={<FileSurfaceLoading />}>
16 <OfficeViewer key={JSON.stringify([props.src, props.kind, props.sizeBytes])} {...props} />
17 </Suspense>
18 );
19}