Open History to see the last commit
1import { useRef } from "react";
2
3import { ThemeToggle } from "@/components/theme/theme-toggle";
4
5import { DevGuideMenu } from "./dev-guide-menu";
6import { GuideDocument } from "./guide-document";
7import { TanStackDbMark } from "./tanstack-db-mark";
8import { useReadingPosition } from "./use-reading-position";
9
10/** The guide as a framed panel next to the app (desktop). */
11export function GuidePanel() {
12 const scrollRef = useRef<HTMLDivElement>(null);
13 useReadingPosition(scrollRef);
14
15 return (
16 <div className="@container/guide flex h-full min-h-0 flex-col">
17 <div className="flex h-12 shrink-0 items-center gap-2 border-b px-3 @md/guide:px-4">
18 <TanStackDbMark />
19 <span className="hidden truncate text-sm font-semibold tracking-tight @md/guide:inline">
20 Try TanStack DB
21 </span>
22 <div className="ml-auto flex min-w-0 items-center gap-2">
23 {import.meta.env.DEV && <DevGuideMenu />}
24 <ThemeToggle />
25 </div>
26 </div>
27 <div ref={scrollRef} className="min-h-0 flex-1 overflow-y-auto overscroll-contain">
28 <GuideDocument />
29 </div>
30 </div>
31 );
32}