summaryrefslogtreecommitdiff
path: root/frontend/src/components/NavStrip.tsx
blob: c0fc0000e14d3c9a700b8c7fd5de06bc8dcf9f08 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import React from 'react'

type NavItem = {
  id: string
  label: string
  icon?: string
}

type Props = {
  items: NavItem[]
  activeId: string
  onSelect: (id: string) => void
}

export const NavStrip: React.FC<Props> = ({ items, activeId, onSelect }) => {
  return (
    <nav className="nav-strip">
      {items.map((item) => (
        <button
          key={item.id}
          className={`nav-strip-item ${activeId === item.id ? 'active' : ''}`}
          onClick={() => onSelect(item.id)}
        >
          {item.icon && <span className="nav-icon">{item.icon}</span>}
          <span className="nav-label">{item.label}</span>
        </button>
      ))}
    </nav>
  )
}