import { IconPlus } from '@material-hu/icons/tabler';
import Stack from '@material-hu/mui/Stack';

import Button from '@material-hu/components/design-system/Buttons/Button';
import Title from '@material-hu/components/design-system/Title';

import { useLokaliseTranslation } from 'src/utils/i18n';

type CategoriesHeaderProps = {
  onCreate: () => void;
};

const CategoriesHeader = ({ onCreate }: CategoriesHeaderProps) => {
  const { t } = useLokaliseTranslation('learning');

  return (
    <Stack
      sx={{
        justifyContent: 'space-between',
        alignItems: 'center',
        flexDirection: 'row',
      }}
    >
      <Title
        variant="L"
        title={t('settings.categories.title')}
        description={t('settings.categories.description')}
      />
      <Button
        variant="primary"
        onClick={onCreate}
        startIcon={<IconPlus size={16} />}
      >
        {t('categories.create')}
      </Button>
    </Stack>
  );
};

export default CategoriesHeader;
