Download web/src/components/NavTabs.tsx from EnergyVenom/patchwise-agent-studio: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/spaces/EnergyVenom/patchwise-agent-studio/resolve/main/web/src/components/NavTabs.tsx
- Command line
-
hf download hf://spaces/EnergyVenom/patchwise-agent-studio/web/src/components/NavTabs.tsx
-
curl -L -o NavTabs.tsx https://huggingface.co/spaces/EnergyVenom/patchwise-agent-studio/resolve/main/web/src/components/NavTabs.tsx
1.12 kB
| import { forwardRef, type ReactNode } from 'react'; | |
| import { Link } from 'react-router-dom'; | |
| export interface NavTab { to: string; label: ReactNode; active: boolean } | |
| /** | |
| * Views of one thing that each have their own address (a run's Scenarios, Failures, Team, Report): links in a named | |
| * navigation bar, the current one marked with aria-current="page", styled as a segmented pill bar. Use this instead of | |
| * Tabs when a "tab" changes the URL: a tablist promises panels on the same page that screen readers can jump to. | |
| * `extra` sits at the end of the bar (a "More" menu). | |
| */ | |
| export const NavTabs = forwardRef<HTMLElement, { label: string; items: NavTab[]; extra?: ReactNode; className?: string }>( | |
| function NavTabs({ label, items, extra, className }, ref) { | |
| return ( | |
| <nav ref={ref} aria-label={label} className={`fpt-navtabs fpt-fade-x${className ? ` ${className}` : ''}`}> | |
| {items.map((t) => ( | |
| <Link key={t.to} to={t.to} className="fpt-navtab" aria-current={t.active ? 'page' : undefined}>{t.label}</Link> | |
| ))} | |
| {extra} | |
| </nav> | |
| ); | |
| }, | |
| ); | |