Skip to content
Source
Sign inSign up
fuko/trytanstackdb.com
Open History to see the last commit

page-pane.tsx

24 lines946 Bytes

1import type { ReactNode } from "react";
2​
3import { useNotesLayout } from "../notes-layout";
4import { MacColumnHeader } from "./controls";
5import { SidebarToggle } from "./sidebar";
6​
7/** A full-width pane next to the sidebar, for pages that aren't notes (settings, analytics). */
8export function MacPagePane({ title, children }: { title: string; children: ReactNode }) {
9 const { sidebarVisible } = useNotesLayout();
10 return (
11 <section
12 aria-label={title}
13 className="flex min-w-0 flex-1 flex-col bg-mac-content text-mac-text"
14 >
15 <MacColumnHeader className="border-b border-mac-column-border">
16 {!sidebarVisible && <SidebarToggle />}
17 <h1 className="px-1 text-[15px] font-semibold">{title}</h1>
18 </MacColumnHeader>
19 <div data-page-scroll className="notes-scroll min-h-0 flex-1 overflow-y-auto">
20 <div className="mx-auto max-w-xl px-6 py-6">{children}</div>
21 </div>
22 </section>
23 );