import { type ActiveOptions, Link, type LinkProps } from '@tanstack/react-router' import type { ReactNode } from 'react' import { cn } from './cn.ts' import { ArrowLeftIcon } from './icons.tsx' import { sidebarRow } from './ui/sidebar.ts' export interface Section { to: NonNullable label: string icon?: ReactNode /** Whether only the section's own path counts as it, not the pages under it. */ exact?: boolean } interface Props { sections: readonly Section[] /** When a section's link counts as the current page, by default its path and the pages under it. */ activeOptions?: ActiveOptions /** A quiet label over the links, for sections in groups. */ label?: string /** Whether the links lead out of these sections, set apart by a line above them. */ apart?: boolean } /** * A list of links to a page's sections, marking the current one. Beside the section on a wide * screen, the open one is a grey tint. */ export function SectionNav(props: Props) { return (
{props.label && (

{props.label}

)}
) } interface HeaderProps { title: string } /** The way back to the chats over the name of these sections, big beside them on a wide screen. */ export function NavHeader(props: HeaderProps) { return ( <> Back to chats

{props.title}

) }