import type { ComponentPropsWithoutRef, ReactNode } from 'react' import { useInAppClick } from './AppProvider' import { cn } from './cn' /** * One tile of an icon rail: the icon in its hover tile, a 9px label * under it (Peek's NavItem, 2026-09-02, verbatim — minus the router). * * The original computed its own active state from the route and rendered * a router link; neither belongs in a shared component. This one takes * `active` and renders an anchor — a router app keeps a thin wrapper * that does its own matching and intercepts the click. * * Active is `bg-selected` on the tile — some themes also give the icon * their interactive colour. */ export interface RailItemProps extends Omit, 'href'> { href: string /** 16px, stroke 1.5. */ icon: ReactNode label: string active?: boolean className?: string } export function RailItem({ href, icon, label, active = false, className, onClick, ...props }: RailItemProps) { const inApp = useInAppClick(href, onClick) return (
{icon}
{label}
) }