import React, { useMemo } from 'react';
import { Layout, Space } from 'antd';
import classNames from 'classnames';
import Title from './Title';
import User from './User';
import Exit from './Exit';
import Logo from '../Logo';

const { Header } = Layout;

export default (props) => {
  const { theme } = props;

  const className = useMemo(() => classNames({
    'layout-header': true,
    'light': theme === 'light',
  }), [theme]);

  return (
    <Header className={className}>
      <Logo />
      <Space>
        <User />
        <Exit />
      </Space>
    </Header>
  )
}
