Sha256: d6e6d582ef1d8e8c3253d2b905e8db7135e6f73b1b24794ad4b375c9f8e2c905
Contents?: true
Size: 712 Bytes
Versions: 15
Compression:
Stored size: 712 Bytes
Contents
import React from "react"; import PropTypes from "prop-types"; export default function Tag(props) { const handleChange = () => { props.toggleEnabled(props.tag); }; let classes = ["tag"]; if (props.enabled) { classes.push("enabled"); } return ( <span className={classes.join(" ")}> <label className="check-box"> <input type="checkbox" name={"tag-" + props.tag} value="1" checked={props.enabled} onChange={handleChange} /> <span className="name">{props.tag}</span> </label> </span> ); } Tag.propTypes = { enabled: PropTypes.bool, tag: PropTypes.string, toggleEnabled: PropTypes.func };
Version data entries
15 entries across 15 versions & 1 rubygems