| 5 | import { i18n } from "~tools" |
| 6 | |
| 7 | export default function ShowTag(props) { |
| 8 | let { name } = props |
| 9 | |
| 10 | const [showTag, setShowTag] = useStorage(`${name}-showTag`, (v) => |
| 11 | v === undefined ? true : v |
| 12 | ) |
| 13 | |
| 14 | return ( |
| 15 | <div className="item"> |
| 16 | <span> |
| 17 | <StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} /> |
| 18 | {i18n("showTag")} |
| 19 | </span> |
| 20 | <input |
| 21 | type="checkbox" |
| 22 | id={`${name}-showTag`} |
| 23 | name={`${name}-showTag`} |
| 24 | className="codebox-offscreen" |
| 25 | checked={showTag} |
| 26 | onChange={(e) => setShowTag(e.target.checked)} |
| 27 | /> |
| 28 | <label className="codebox-switch" htmlFor={`${name}-showTag`}></label> |
| 29 | </div> |
| 30 | ) |
| 31 | } |