import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';

import './hint.scss';

const propTypes = {
  variant: PropTypes.oneOf(['success', 'danger']),
  className: PropTypes.string,
  component: PropTypes.oneOfType([
    PropTypes.string,
    PropTypes.object,
    PropTypes.element
  ])
};

const defaultProps = {
  variant: null,
  className: null,
  component: 'p'
};


const Hint = ({ component: Component, variant, className, ...props }) => (
  <Component
    styleName={classNames('base', variant)}
    className={className}
    {...props}
  />
);


Hint.propTypes = propTypes;
Hint.defaultProps = defaultProps;

export default Hint;
