client-tree.tsx
This file
Path
apps/web/src/features/code/client-tree.tsx
23 lines · 600 bytes · TypeScript
Last changed by
Merge build/comments-web-features into mainoscabrielbefore adoption74bfc72
History of this fileTake it
Merge branch 'build/904-web-code-browser'oscabrielbefore adoption06e2229
lines 1–23why, one step back1import { ClientOnly } from "@tanstack/react-router";2import { lazy, Suspense } from "react";3import type { ReactNode } from "react";45import type { RepoTreeProps } from "./repo-tree.tsx";67const TreeLater = import.meta.env.SSR8 ? undefined9 : lazy(() => import("./repo-tree.tsx"));1011export const ClientTree = ({12 fallback = null,13 ...props14}: RepoTreeProps & { readonly fallback?: ReactNode }) =>15 TreeLater === undefined ? (16 fallback17 ) : (18 <ClientOnly fallback={fallback}>19 <Suspense fallback={fallback}>20 <TreeLater {...props} />21 </Suspense>22 </ClientOnly>23 );