|
| 1 | +import React from "react"; |
| 2 | +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; |
| 3 | +import { faInfoCircle } from "@fortawesome/free-solid-svg-icons"; |
| 4 | +import { LOGO_DATA_URL } from "../constants/logo"; |
| 5 | + |
| 6 | +function ManualClassificationWarningPopUp({ closePopup, isDark }) { |
| 7 | + return ( |
| 8 | + <div |
| 9 | + style={{ |
| 10 | + position: "fixed", |
| 11 | + inset: 0, |
| 12 | + zIndex: 50, |
| 13 | + display: "flex", |
| 14 | + alignItems: "center", |
| 15 | + justifyContent: "center", |
| 16 | + backgroundColor: isDark ? "rgba(0, 0, 0, 0.8)" : "rgba(0, 0, 0, 0.4)", |
| 17 | + backdropFilter: "blur(4px)", |
| 18 | + }} |
| 19 | + onClick={closePopup} |
| 20 | + > |
| 21 | + <div |
| 22 | + style={{ |
| 23 | + position: "relative", |
| 24 | + width: "100%", |
| 25 | + maxWidth: "480px", |
| 26 | + margin: "0 24px", |
| 27 | + backgroundColor: "var(--bg-elevated)", |
| 28 | + borderRadius: "16px", |
| 29 | + border: "1px solid var(--border-default)", |
| 30 | + boxShadow: "var(--shadow-lg)", |
| 31 | + }} |
| 32 | + onClick={(e) => e.stopPropagation()} |
| 33 | + > |
| 34 | + {/* Close button */} |
| 35 | + <button |
| 36 | + onClick={closePopup} |
| 37 | + type="button" |
| 38 | + style={{ |
| 39 | + position: "absolute", |
| 40 | + top: "16px", |
| 41 | + right: "16px", |
| 42 | + width: "32px", |
| 43 | + height: "32px", |
| 44 | + display: "flex", |
| 45 | + alignItems: "center", |
| 46 | + justifyContent: "center", |
| 47 | + borderRadius: "8px", |
| 48 | + border: "none", |
| 49 | + backgroundColor: "transparent", |
| 50 | + color: "var(--text-tertiary)", |
| 51 | + cursor: "pointer", |
| 52 | + transition: "all 0.15s ease", |
| 53 | + }} |
| 54 | + onMouseEnter={(e) => { |
| 55 | + e.currentTarget.style.backgroundColor = "var(--bg-tertiary)"; |
| 56 | + e.currentTarget.style.color = "var(--text-primary)"; |
| 57 | + }} |
| 58 | + onMouseLeave={(e) => { |
| 59 | + e.currentTarget.style.backgroundColor = "transparent"; |
| 60 | + e.currentTarget.style.color = "var(--text-tertiary)"; |
| 61 | + }} |
| 62 | + > |
| 63 | + <svg width="14" height="14" viewBox="0 0 14 14" fill="currentColor"> |
| 64 | + <path d="M13.7 0.3c-0.4-0.4-1-0.4-1.4 0L7 5.6 1.7 0.3c-0.4-0.4-1-0.4-1.4 0s-0.4 1 0 1.4L5.6 7l-5.3 5.3c-0.4 0.4-0.4 1 0 1.4 0.2 0.2 0.4 0.3 0.7 0.3s0.5-0.1 0.7-0.3L7 8.4l5.3 5.3c0.2 0.2 0.5 0.3 0.7 0.3s0.5-0.1 0.7-0.3c0.4-0.4 0.4-1 0-1.4L8.4 7l5.3-5.3c0.4-0.4 0.4-1 0-1.4z" /> |
| 65 | + </svg> |
| 66 | + </button> |
| 67 | + |
| 68 | + <div style={{ padding: "32px" }}> |
| 69 | + {/* Header with logo */} |
| 70 | + <div |
| 71 | + style={{ |
| 72 | + display: "flex", |
| 73 | + alignItems: "center", |
| 74 | + gap: "12px", |
| 75 | + marginBottom: "20px", |
| 76 | + }} |
| 77 | + > |
| 78 | + <img |
| 79 | + src={LOGO_DATA_URL} |
| 80 | + alt="Rica" |
| 81 | + style={{ width: "36px", height: "36px" }} |
| 82 | + /> |
| 83 | + <div> |
| 84 | + <h1 |
| 85 | + style={{ |
| 86 | + fontSize: "20px", |
| 87 | + fontWeight: 600, |
| 88 | + color: "var(--text-primary)", |
| 89 | + margin: 0, |
| 90 | + letterSpacing: "-0.02em", |
| 91 | + }} |
| 92 | + > |
| 93 | + Manual Classifications Detected |
| 94 | + </h1> |
| 95 | + </div> |
| 96 | + </div> |
| 97 | + |
| 98 | + {/* Info box */} |
| 99 | + <div |
| 100 | + style={{ |
| 101 | + display: "flex", |
| 102 | + alignItems: "flex-start", |
| 103 | + gap: "12px", |
| 104 | + padding: "14px 16px", |
| 105 | + backgroundColor: isDark ? "rgba(59, 130, 246, 0.1)" : "rgba(59, 130, 246, 0.08)", |
| 106 | + borderRadius: "10px", |
| 107 | + marginBottom: "20px", |
| 108 | + border: `1px solid ${isDark ? "rgba(59, 130, 246, 0.3)" : "rgba(59, 130, 246, 0.2)"}`, |
| 109 | + }} |
| 110 | + > |
| 111 | + <FontAwesomeIcon |
| 112 | + icon={faInfoCircle} |
| 113 | + style={{ |
| 114 | + fontSize: "18px", |
| 115 | + color: isDark ? "#60a5fa" : "#3b82f6", |
| 116 | + marginTop: "2px", |
| 117 | + flexShrink: 0, |
| 118 | + }} |
| 119 | + /> |
| 120 | + <div style={{ flex: 1 }}> |
| 121 | + <p |
| 122 | + style={{ |
| 123 | + fontSize: "14px", |
| 124 | + color: "var(--text-primary)", |
| 125 | + lineHeight: 1.6, |
| 126 | + margin: 0, |
| 127 | + marginBottom: "8px", |
| 128 | + }} |
| 129 | + > |
| 130 | + This folder contains a <strong>manual_classification.tsv</strong> file with previously saved classifications. |
| 131 | + </p> |
| 132 | + <p |
| 133 | + style={{ |
| 134 | + fontSize: "14px", |
| 135 | + color: "var(--text-secondary)", |
| 136 | + lineHeight: 1.6, |
| 137 | + margin: 0, |
| 138 | + }} |
| 139 | + > |
| 140 | + Your previous manual classifications have been loaded and are displayed in the component table. |
| 141 | + </p> |
| 142 | + </div> |
| 143 | + </div> |
| 144 | + |
| 145 | + <p |
| 146 | + style={{ |
| 147 | + fontSize: "14px", |
| 148 | + color: "var(--text-secondary)", |
| 149 | + lineHeight: 1.6, |
| 150 | + marginBottom: "16px", |
| 151 | + }} |
| 152 | + > |
| 153 | + <strong>To start fresh:</strong> |
| 154 | + </p> |
| 155 | + |
| 156 | + <ul |
| 157 | + style={{ |
| 158 | + fontSize: "14px", |
| 159 | + color: "var(--text-secondary)", |
| 160 | + lineHeight: 1.8, |
| 161 | + marginBottom: "24px", |
| 162 | + paddingLeft: "20px", |
| 163 | + }} |
| 164 | + > |
| 165 | + <li> |
| 166 | + Delete <code style={{ |
| 167 | + backgroundColor: "var(--bg-tertiary)", |
| 168 | + padding: "2px 6px", |
| 169 | + borderRadius: "4px", |
| 170 | + fontFamily: "monospace", |
| 171 | + fontSize: "13px" |
| 172 | + }}>manual_classification.tsv</code> from your tedana folder, or |
| 173 | + </li> |
| 174 | + <li> |
| 175 | + Use the <strong>Reset</strong> button in Rica to revert to the original tedana classifications |
| 176 | + </li> |
| 177 | + </ul> |
| 178 | + |
| 179 | + {/* Action button */} |
| 180 | + <button |
| 181 | + onClick={closePopup} |
| 182 | + style={{ |
| 183 | + width: "100%", |
| 184 | + display: "flex", |
| 185 | + alignItems: "center", |
| 186 | + justifyContent: "center", |
| 187 | + height: "44px", |
| 188 | + fontSize: "14px", |
| 189 | + fontWeight: 500, |
| 190 | + color: isDark ? "#0a0a0b" : "#ffffff", |
| 191 | + backgroundColor: isDark ? "#fafafa" : "#111827", |
| 192 | + border: "none", |
| 193 | + borderRadius: "10px", |
| 194 | + cursor: "pointer", |
| 195 | + transition: "all 0.15s ease", |
| 196 | + }} |
| 197 | + onMouseEnter={(e) => (e.currentTarget.style.opacity = "0.9")} |
| 198 | + onMouseLeave={(e) => (e.currentTarget.style.opacity = "1")} |
| 199 | + > |
| 200 | + Got it |
| 201 | + </button> |
| 202 | + </div> |
| 203 | + </div> |
| 204 | + </div> |
| 205 | + ); |
| 206 | +} |
| 207 | + |
| 208 | +export default ManualClassificationWarningPopUp; |
0 commit comments