import React from 'react';
import styled from 'styled-components';
import PropTypes from 'prop-types';

const Root = styled.div`
  position: relative;
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
  border-radius: 4px;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: baseline;
  letter-spacing: 0.05em;
  color: rgb(40, 46, 104);

  ${props =>
    !props.light &&
    `
    padding: 4px;
    background-color: rgb(237, 240, 253);
  `};
`;

export default function Chip({ children, light }) {
  return (
    <Root className="chip" light={light}>
      {children}
    </Root>
  );
}

Chip.propTypes = {
  children: PropTypes.node,
  light: PropTypes.node.bool
};
