import { type FC } from 'react';
import { useNavigate } from 'react-router-dom';

import HuTaskFocusHeader from '@material-hu/components/design-system/Header/TaskFocus';

import { feedRoutes } from 'src/pages/dashboard/feed/routes';

type HeaderProps = {
  title: string;
};

const Header: FC<HeaderProps> = props => {
  const { title } = props;
  const navigate = useNavigate();

  return (
    <HuTaskFocusHeader
      title={title}
      onClose={() => navigate(feedRoutes.feed())}
    />
  );
};

export default Header;
