import { useState, type PointerEvent } from "react"; type ShowcaseVisualProps = { activeIndex: number; }; type CaptureTool = "rect" | "arrow" | "pen" | "mosaic"; type OcrLanguage = "zh" | "en" | "auto"; type UploadDestination = { id: "obs" | "ssh" | "ftp"; label: string; detail: string; }; const destinations: UploadDestination[] = [ { id: "obs", label: "OBS", detail: "Bucket" }, { id: "ssh", label: "SSH", detail: "Server" }, { id: "ftp", label: "FTP", detail: "Remote" }, ]; const uploadRoutes: Record = { obs: "M 50 30 C 59 30 61 17 71 17", ssh: "M 50 30 C 58 30 63 30 71 30", ftp: "M 50 30 C 59 30 61 43 71 43", }; const ocrModes: Array<{ id: OcrLanguage; label: string; name: string; lines: string[]; characters: number; confidence: string; }> = [ { id: "zh", label: "中", name: "中文", lines: ["让每一次截图直接进入下一步。"], characters: 15, confidence: "99.5%", }, { id: "en", label: "EN", name: "English", lines: ["Capture, understand, share."], characters: 27, confidence: "99.1%", }, { id: "auto", label: "AUTO", name: "中英混排", lines: ["Capture, understand, share.", "让每一次截图直接进入下一步。"], characters: 42, confidence: "99.2%", }, ]; const aiModes = [ { id: "vision", label: "识图", result: "检测到系统权限弹窗,截图权限尚未开启。", score: "96%", }, { id: "summary", label: "总结", result: "当前页面包含 3 个设置项,建议先开启屏幕录制权限。", score: "93%", }, { id: "question", label: "问答", result: "前往系统设置中的隐私与安全性即可完成授权。", score: "98%", }, ]; const captureTools: Array<{ id: CaptureTool; label: string }> = [ { id: "rect", label: "矩形" }, { id: "arrow", label: "箭头" }, { id: "pen", label: "画笔" }, { id: "mosaic", label: "马赛克" }, ]; function stopSceneDrag(event: PointerEvent) { event.stopPropagation(); } function UploadScene() { const [selected, setSelected] = useState(destinations[0]); const routePath = uploadRoutes[selected.id]; return (
SCREENSHOT-1428.PNG
{destinations.map((destination) => ( ))}
LINK COPIED cdn.snapgo.dev/{selected.id}/...
); } function IdentificationScene() { const [mode, setMode] = useState(aiModes[0]); return (
!
Permission required Screen Recording
SnapGo Vision

{mode.result}

{mode.score} confidence
{aiModes.map((item) => ( ))}
); } function OcrScene() { const [copied, setCopied] = useState(false); const [language, setLanguage] = useState("auto"); const activeMode = ocrModes.find((mode) => mode.id === language) ?? ocrModes[2]; function selectLanguage(mode: OcrLanguage) { setLanguage(mode); setCopied(false); } return (
Release notes Capture, understand, share. 让每一次截图直接进入下一步。
OCR {activeMode.name}

{activeMode.lines.map((line) => {line})}

{activeMode.characters} characters {activeMode.confidence}
{ocrModes.map((mode) => ( ))}
); } function ToolGlyph({ tool }: { tool: CaptureTool }) { if (tool === "rect") { return ; } if (tool === "arrow") { return ; } if (tool === "pen") { return ; } return ( ); } function AnnotationPreview({ tool }: { tool: CaptureTool }) { if (tool === "arrow") { return ( ); } if (tool === "pen") { return ( ); } if (tool === "mosaic") { return ; } return ; } function CaptureScene() { const [tool, setTool] = useState("rect"); return (
Project overview
1280 × 720
{captureTools.map((item) => ( ))}
); } const scenes = [UploadScene, IdentificationScene, OcrScene, CaptureScene]; export default function ShowcaseVisual({ activeIndex }: ShowcaseVisualProps) { const Scene = scenes[activeIndex] ?? UploadScene; return (
); }