Sha256: 725f48b6a096be2ba38a935ce14a8ef8df967c3db6c736c0bcec1acb8c9af9c2
Contents?: true
Size: 687 Bytes
Versions: 5
Compression:
Stored size: 687 Bytes
Contents
import React from "react"; interface TagProps { enabled: boolean; tag: string; toggleEnabled: (string) => void; } export default function Tag(props: TagProps): JSX.Element { const handleChange = () => { props.toggleEnabled(props.tag); }; const 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> ); }
Version data entries
5 entries across 5 versions & 1 rubygems