{"size": 1061, "ext": "js", "max_stars_repo_path": "demo/components/Article/ArticleHeader/styles/ArticleHeaderStyled.js", "max_stars_repo_name": "bcrumbs/reactackle", "max_stars_repo_stars_event_min_datetime": "2017-07-27T10:35:03.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-01T09:00:33.000Z", "max_issues_repo_path": "demo/components/Article/ArticleHeader/styles/ArticleHeaderStyled.js", "max_issues_repo_name": "bcrumbs/reactackle", "max_issues_repo_issues_event_min_datetime": "2017-07-31T21:58:23.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T01:35:32.000Z", "max_forks_repo_path": "demo/components/Article/ArticleHeader/styles/ArticleHeaderStyled.js", "max_forks_repo_name": "bcrumbs/reactackle", "max_forks_repo_forks_event_min_datetime": "2017-08-02T20:44:41.000Z", "max_forks_repo_forks_event_max_datetime": "2021-04-22T07:02:50.000Z"}
{"max_stars_count": 305, "max_issues_count": 114, "max_forks_count": 28, "avg_line_length": 19.6481481481, "max_line_length": 59, "alphanum_fraction": 0.6682375118}
'use strict';

import PropTypes from 'prop-types';
import styled, { css } from 'styled-components';

import {
  baseModule,
  colorMain,
  fontSizeTitle,
  fontSizeDisplay2,
  fontWeightNormal,
  fontWeightSemibold,
  bodyFontColor,
} from '../../../../theme/styleHelpers';

const propTypes = {
  level: PropTypes.oneOf([1, 2]),
};

const defaultProps = {
  level: 2,
};

const level1 = () => css`    
  font-size: ${fontSizeDisplay2}px;
  font-weight: ${fontWeightNormal};
  color: ${colorMain};
`;

const level2 = () => css`    
  font-size: ${fontSizeTitle}px;
  font-weight: ${fontWeightSemibold};
  color: ${bodyFontColor};
  margin-bottom: ${baseModule(2)}px;
`;

const style = ({ level }) => level === 2 ? level2 : level1;

/** STYLES */
export const ArticleHeaderStyled = styled.div`
  margin: 0;
  padding: 0;
  margin-top: ${baseModule(4)}px;
  ${style}
  
  &:first-child {
    margin-top: 0;
  }
`;

ArticleHeaderStyled.propTypes = propTypes;
ArticleHeaderStyled.defaultProps = defaultProps;
ArticleHeaderStyled.displayName = 'ArticleHeaderStyled';
