The best way to control Claude Code, Codex and more from any computer or phone

main
tsx 19 lines 574 Bytes
Raw
1 import type { OfficePreviewKind } from "@t3tools/shared/filePreview";
2 import { lazy, Suspense } from "react";
3
4 import { FileSurfaceLoading } from "./fileSurfaceChrome";
5
6 const OfficeViewer = lazy(() => import("./OfficeViewer"));
7
8 export 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 }