redbadger/website-honestly

View on GitHub
site/components/hr/index.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
// @flow
import React from 'react';
import classNames from 'classnames';
import styles from './style.css';

type HRProps = {
  color: 'red' | 'grey' | 'black',
  customClassName?: string,
};

const HR = ({ customClassName = 'horizontal-line', color }: HRProps) => {
  const hrClass = classNames({
    [styles.hr]: true,
    [styles.red]: color === 'red',
    [styles.grey]: color === 'grey',
    [styles.black]: color === 'black',
    [customClassName]: true,
  });

  return <hr className={hrClass} />;
};

export default HR;