import { Title, AppShell, Flex, Box, Paper } from "@mantine/core";
import { HeaderConfig } from "../types/header-config";
import BackButton from "./back-button";

interface HeaderProps extends HeaderConfig {}

const Header = ({ collapsed, title, withBackButton }: HeaderProps) => {
  return (
    <AppShell.Header
      id='app-header'
      display={collapsed ? 'none' : 'flex'}
      style={{ alignItems: 'center', justifyContent: 'center' }}
    >
      { withBackButton && <BackButton /> }
      <Flex justify='center' px='md' mt={8}>
        <Title order={1}>{title?.toLocaleUpperCase()}</Title>
      </Flex>
    </AppShell.Header>
  );
}

export default Header;
