Spaces:
Sleeping
Sleeping
feat: add SOS survival button to main toolbar
Browse files- src/components/MainView.jsx +15 -0
src/components/MainView.jsx
CHANGED
|
@@ -3,6 +3,7 @@ import { Video, FolderOpen, MessageSquare, Shield, ScanSearch, Settings, Sparkle
|
|
| 3 |
import { useMedia } from "../contexts/MediaContext";
|
| 4 |
import ScanningOverlay from "./ScanningOverlay";
|
| 5 |
import ChatOverlay from "./ChatOverlay";
|
|
|
|
| 6 |
import DetectionPanel from "./DetectionPanel";
|
| 7 |
import SettingsPanel from "./SettingsPanel";
|
| 8 |
import ImageGenPanel from "./ImageGenPanel";
|
|
@@ -17,6 +18,7 @@ export default function MainView() {
|
|
| 17 |
const [showDetection, setShowDetection] = useState(false);
|
| 18 |
const [showSettings, setShowSettings] = useState(false);
|
| 19 |
const [showImageGen, setShowImageGen] = useState(false);
|
|
|
|
| 20 |
const fileInputRef = useRef(null);
|
| 21 |
|
| 22 |
const handleScanStart = useCallback((dataUrl) => {
|
|
@@ -153,6 +155,16 @@ export default function MainView() {
|
|
| 153 |
<Sparkles className="size-4" />
|
| 154 |
<span className="text-xs font-medium">Image</span>
|
| 155 |
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
{/* Settings button */}
|
| 157 |
<button
|
| 158 |
type="button"
|
|
@@ -203,6 +215,9 @@ export default function MainView() {
|
|
| 203 |
{showImageGen && (
|
| 204 |
<ImageGenPanel onClose={() => setShowImageGen(false)} />
|
| 205 |
)}
|
|
|
|
|
|
|
|
|
|
| 206 |
</div>
|
| 207 |
);
|
| 208 |
}
|
|
|
|
| 3 |
import { useMedia } from "../contexts/MediaContext";
|
| 4 |
import ScanningOverlay from "./ScanningOverlay";
|
| 5 |
import ChatOverlay from "./ChatOverlay";
|
| 6 |
+
import SurvivalPanel from "./SurvivalPanel";
|
| 7 |
import DetectionPanel from "./DetectionPanel";
|
| 8 |
import SettingsPanel from "./SettingsPanel";
|
| 9 |
import ImageGenPanel from "./ImageGenPanel";
|
|
|
|
| 18 |
const [showDetection, setShowDetection] = useState(false);
|
| 19 |
const [showSettings, setShowSettings] = useState(false);
|
| 20 |
const [showImageGen, setShowImageGen] = useState(false);
|
| 21 |
+
const [showSurvival, setShowSurvival] = useState(false);
|
| 22 |
const fileInputRef = useRef(null);
|
| 23 |
|
| 24 |
const handleScanStart = useCallback((dataUrl) => {
|
|
|
|
| 155 |
<Sparkles className="size-4" />
|
| 156 |
<span className="text-xs font-medium">Image</span>
|
| 157 |
</button>
|
| 158 |
+
{/* Survival button */}
|
| 159 |
+
<button
|
| 160 |
+
type="button"
|
| 161 |
+
onClick={() => setShowSurvival(true)}
|
| 162 |
+
title="Survival Guide"
|
| 163 |
+
className="flex items-center gap-1.5 rounded-full bg-red-500/20 border border-red-400/30 px-3 py-1.5 text-red-400 transition-colors hover:bg-red-500/30"
|
| 164 |
+
>
|
| 165 |
+
<Shield className="size-4" />
|
| 166 |
+
<span className="text-xs font-medium">SOS</span>
|
| 167 |
+
</button>
|
| 168 |
{/* Settings button */}
|
| 169 |
<button
|
| 170 |
type="button"
|
|
|
|
| 215 |
{showImageGen && (
|
| 216 |
<ImageGenPanel onClose={() => setShowImageGen(false)} />
|
| 217 |
)}
|
| 218 |
+
|
| 219 |
+
{/* Survival Panel */}
|
| 220 |
+
<SurvivalPanel isOpen={showSurvival} onClose={() => setShowSurvival(false)} />
|
| 221 |
</div>
|
| 222 |
);
|
| 223 |
}
|