wing-ops/frontend/src/common/components/layout/SubMenuBar.tsx
htlee a61864646f refactor(frontend): 공통 모듈 common/ 분리 + OpenLayers 제거 + path alias 설정
- OpenLayers(ol) 패키지 제거 (미사용, import 0건)
- common/ 디렉토리 생성: components, hooks, services, store, types, utils
- 17개 공통 파일을 common/으로 이동 (git mv, blame 이력 보존)
- MainTab 타입을 App.tsx에서 common/types/navigation.ts로 분리
- tsconfig path alias (@common/*, @tabs/*) + vite resolve.alias 설정
- 42개 import 경로를 @common/ alias 또는 상대경로로 수정

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 14:00:50 +09:00

41 lines
1.2 KiB
TypeScript
Executable File

import type { MainTab } from '../../types/navigation'
import { useSubMenu } from '../../hooks/useSubMenu'
interface SubMenuBarProps {
activeMainTab: MainTab
}
export function SubMenuBar({ activeMainTab }: SubMenuBarProps) {
const { activeSubTab, setActiveSubTab, subMenuConfig } = useSubMenu(activeMainTab)
// 서브 메뉴가 없는 탭은 표시하지 않음
if (!subMenuConfig || subMenuConfig.length === 0) {
return null
}
return (
<div className="border-b border-border bg-bg-1" style={{ flexShrink: 0 }}>
<div className="flex px-5">
{subMenuConfig.map((item) => (
<button
key={item.id}
onClick={() => setActiveSubTab(item.id)}
className={`
px-4 py-2.5 text-[13px] font-bold transition-all duration-200
font-korean tracking-tight
${
activeSubTab === item.id
? 'text-primary-cyan bg-[rgba(6,182,212,0.12)] border-b-2 border-primary-cyan'
: 'text-text-2 hover:text-text-1 hover:bg-[rgba(255,255,255,0.06)]'
}
`}
>
<span className="mr-1.5">{item.icon}</span>
{item.label}
</button>
))}
</div>
</div>
)
}