Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

BinaryFilePreview.tsx

18 lines462 Bytes

1import { lazy, Suspense } from "react";
2​
3import { FileSurfaceLoading } from "./fileSurfaceChrome";
4​
5const BinaryViewer = lazy(() => import("./BinaryViewer"));
6​
7export function BinaryFilePreview(props: {
8 readonly src: string;
9 readonly name: string;
10 readonly kind: "archive" | "sqlite";
11 readonly onRetry?: () => void;
12}) {
13 return (
14 <Suspense fallback={<FileSurfaceLoading />}>
15 <BinaryViewer key={props.src} {...props} />
16 </Suspense>
17 );