import React from 'react';
import { Menu } from 'antd';

export default (props) => {
  const { items, location } = props;

  const selectedKeys = React.useMemo(() => `/${location.pathname.split('/')[1]}`, [location.pathname]);

  return (
    <Menu className='split-menu' mode="horizontal" items={items} selectedKeys={selectedKeys} />
  )
}
