Files

24 lines
774 B
TypeScript
Raw Permalink Normal View History

2026-10-12 08:48:20 -04:00
import type { ReactNode } from 'react';
2026-10-05 18:10:18 -04:00
import NamedIcon from '@/components/elements/NamedIcon';
2026-10-12 08:48:20 -04:00
export interface NavigationLabelProps {
label: string;
/** Shown as the label's title. */
group?: string | null;
/** A lucide icon name. */
icon?: string | null;
/** A navigation item's `state.badge`. */
badge?: ReactNode;
}
2026-10-05 18:10:18 -04:00
2026-10-12 08:48:20 -04:00
/** A navigation item's icon, label and badge. */
export default function NavigationLabel({ label, group, icon, badge }: NavigationLabelProps) {
2026-10-05 18:10:18 -04:00
return (
2026-10-12 08:48:20 -04:00
<span className='inline-flex items-center gap-2 align-top' title={group ?? undefined}>
2026-10-08 16:53:20 -04:00
{icon && <NamedIcon name={icon} size={16} className='shrink-0' aria-hidden />}
2026-10-05 18:10:18 -04:00
<span>{label}</span>
2026-10-12 08:48:20 -04:00
{badge}
2026-10-05 18:10:18 -04:00
</span>
);
}