MCPcopy Create free account
hub / github.com/027xiguapi/code-box / ToolBox

Function ToolBox

component/ui/toolBox.tsx:37–112  ·  view source on GitHub ↗
(props: any)

Source from the content-addressed store, hash-verified

35}
36
37export default function ToolBox(props: any) {
38 const [isShowTag, setIsShowTag] = useState(true)
39 const handleGetDescription = () => {
40 props.onGetDescription()
41 }
42
43 const handleEditMarkdown = () => {
44 props.onEditMarkdown()
45 }
46
47 const handleDownloadMarkdown = () => {
48 props.onDownloadMarkdown()
49 }
50
51 const handleParseMarkdown = () => {
52 props.onParseMarkdown()
53 }
54
55 const handlePrint = () => {
56 props.onPrint()
57 }
58
59 const handleDownloadWord = () => {
60 props.onDownloadWord?.()
61 }
62
63 const getArticle = () => {
64 const href = encodeURIComponent(location.href)
65 window.open(`https://paywallbuster.com/articles/?article=${href}`)
66 }
67
68 const handleClose = () => {
69 setIsShowTag(false)
70 }
71
72 return isShowTag ? (
73 <div
74 id="ws_cmbm"
75 className="ws_cmbmc"
76 style={{ ...boxStyles.box, ...props.style }}>
77 <button style={boxStyles.close} onClick={handleClose} aria-label="Close">
78 ×
79 </button>
80 <img src={qrcodeUrl} alt="qrcodeUrl" style={boxStyles.img} />
81 <div style={boxStyles.item}>
82 <a onClick={handleGetDescription}>{i18n("getDescription")}</a>
83 </div>
84 <div style={boxStyles.item}>
85 <a onClick={handleEditMarkdown}>{i18n("editMarkdown")}</a>
86 </div>
87 <div style={boxStyles.item}>
88 <a onClick={handleDownloadMarkdown}>{i18n("downloadMarkdown")}</a>
89 </div>
90 <div style={boxStyles.item}>
91 <a onClick={handleParseMarkdown}>{i18n("parseMarkdown")}</a>
92 </div>
93 <div style={boxStyles.item}>
94 <a onClick={handlePrint}>{i18n("downloadPdf")}</a>

Callers

nothing calls this directly

Calls 3

editQRCodeImgFunction · 0.90
i18nFunction · 0.85
getArticleFunction · 0.70

Tested by

no test coverage detected