Sha256: 1fa6cd03181d5dbaf4e95383fd5bb6cac1e9353b769c41324d07ec9866d3e2b4
Contents?: true
Size: 746 Bytes
Versions: 4
Compression:
Stored size: 746 Bytes
Contents
import React from "react"; import * as Tags from "../../types/Tags"; interface Props { enabled: boolean; tag: string; dispatch: (action: Tags.Action) => void; } export default function Tag(props: Props) { const handleChange = () => { props.dispatch({ type: "toggleTag", payload: 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
4 entries across 4 versions & 1 rubygems