Function
HeaderButton
({
'aria-label': ariaLabel,
className,
endIcon,
icon,
label,
size = 'sm',
...props
}: HeaderButtonProps)
Source from the content-addressed store, hash-verified
| 16 | // auto-derived from `label` when it's a plain string so the icon-only mobile |
| 17 | // state stays accessible without the caller having to remember it. |
| 18 | export function HeaderButton({ |
| 19 | 'aria-label': ariaLabel, |
| 20 | className, |
| 21 | endIcon, |
| 22 | icon, |
| 23 | label, |
| 24 | size = 'sm', |
| 25 | ...props |
| 26 | }: HeaderButtonProps) { |
| 27 | const accessibleLabel = ariaLabel ?? (typeof label === 'string' ? label : undefined); |
| 28 | |
| 29 | return ( |
| 30 | <Button |
| 31 | aria-label={accessibleLabel} |
| 32 | className={cn('w-8 px-0 md:w-auto md:px-3', className)} |
| 33 | size={size} |
| 34 | {...props} |
| 35 | > |
| 36 | {icon} |
| 37 | <span className="hidden md:inline">{label}</span> |
| 38 | {endIcon ? <span className="hidden md:inline-flex">{endIcon}</span> : null} |
| 39 | </Button> |
| 40 | ); |
| 41 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected