import React from 'react'
import { RouteProps } from '../@types';
import config from '../router.config'
import style from './style.module.css'

function SubHead(props: RouteProps) {
  let item = config.find(item => props.match.path === item.path)
  
  return item ? (
    <h2 className={style.subhead}>
      {item.title}
    </h2>
  ): null
}

export default SubHead