import { forwardRef } from "react"; import { createLink, type LinkComponent } from "@tanstack/react-router"; import { Tabs } from "@cloudflare/kumo/components/tabs"; import { cn } from "~/utils/cn"; type AnchorProps = React.AnchorHTMLAttributes; const SideNavAnchor = forwardRef(function SideNavAnchor( { className, children, ...rest }, ref, ) { return ( {children} ); }); SideNavAnchor.displayName = "SideNavAnchor"; const RouterSideNavLink = createLink(SideNavAnchor); /** Vertical settings-style navigation item. */ export const SideNavLink: LinkComponent = (props) => ; export function SideNav({ title, className, children, }: { title?: React.ReactNode; className?: string; children: React.ReactNode; }) { return ( ); } export type RouteTab = { /** Stable id, usually the route path. */ value: string; label: React.ReactNode; /** A router `` element; Kumo merges tab props and the label into it. */ link: React.ReactElement; active: boolean; }; /** Underline tabs whose selection follows the current route; each tab navigates via its link. */ export function RouteTabs({ tabs, className }: { tabs: ReadonlyArray; className?: string }) { const active = tabs.find((tab) => tab.active)?.value; return ( ({ value: tab.value, label: tab.label, render: tab.link, nativeButton: false }))} /> ); } /** Two-column layout: side navigation on the left, content on the right. */ export function SideNavLayout({ className, children }: { className?: string; children: React.ReactNode }) { return
{children}
; }