import React from 'react'; import { useLocation } from 'react-router-dom'; import { navLinks } from '../routes.jsx'; import './PageHeader.css'; const PageHeader = () => { const { pathname } = useLocation(); // Home 페이지에서는 Hero 섹션이 있으므로 숨김 if (pathname === '/') return null; // stock/trade 같은 하위 경로도 stock로 매칭 const current = navLinks.find((link) => { if (link.path === '/') return false; return pathname === link.path || pathname.startsWith(link.path + '/'); }); if (!current) return null; return (

{current.subtitle}

{current.label}

); }; export default PageHeader;