All files Tag.js

100% Statements 6/6
100% Branches 4/4
100% Functions 2/2
100% Lines 6/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27        2x 56x 2x   2x     56x           56x                  
// @flow
 
import React  from 'react';
 
const Tag = (props: Object) => {
  const onRemoveClick = (e: MouseEvent) => {
    e.preventDefault();
 
    props.onRemoveTag(e);
  };
 
  const removeIcon: ?React$Element<any> = !props.readOnly ? (
    <a onClick={onRemoveClick}>
      {props.removeTagIcon|| String.fromCharCode(215)}
    </a>
  ) : null;
 
  return (
    <li>
      {props.name}
      {removeIcon}
    </li>
  );
};
 
export default Tag;