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

Function Modal

component/ui/modal.tsx:5–66  ·  view source on GitHub ↗
({ isOpen, onClose, onConfirm, message })

Source from the content-addressed store, hash-verified

3import ValidateContent from "~component/contents/validateContent"
4
5const Modal = ({ isOpen, onClose, onConfirm, message }) => {
6 if (!isOpen) return null
7
8 const modalOverlayStyle = {
9 position: "fixed",
10 top: 0,
11 left: 0,
12 right: 0,
13 bottom: 0,
14 background: "rgba(0, 0, 0, 0.5)",
15 display: "flex",
16 justifyContent: "center",
17 alignItems: "center",
18 zIndex: 1000
19 }
20
21 const modalStyle = {
22 background: "white",
23 padding: "20px",
24 borderRadius: "8px",
25 boxShadow: "0 4px 8px rgba(0, 0, 0, 0.1)",
26 textAlign: "center"
27 }
28
29 const modalButtonsStyle = {
30 marginTop: "20px"
31 }
32
33 const buttonStyle = {
34 borderRadius: "4px",
35 padding: "2px 7px",
36 margin: "0 10px",
37 fontSize: "16px",
38 cursor: "pointer"
39 }
40
41 const cancelBtnStyle = {
42 ...buttonStyle,
43 backgroundColor: "#d9363e",
44 border: "1px solid #d9363e",
45 color: "#fff"
46 }
47
48 const confirmBtnStyle = {
49 ...buttonStyle,
50 backgroundColor: "#1677FF",
51 border: "1px solid #1677FF",
52 color: "#fff"
53 }
54
55 return (
56 <div style={modalOverlayStyle as React.CSSProperties}>
57 <div style={modalStyle as React.CSSProperties}>
58 <ValidateContent
59 type="parseMarkdown"
60 handleOk={onConfirm}
61 handleCancel={onClose}
62 />

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected