import { useState } from "react"; import "../types/preload"; interface OverlayProps { defaultPath?: string; } export default function Overlay({ defaultPath = "" }: OverlayProps) { const [dir, setDir] = useState(defaultPath); const [status, setStatus] = useState<"idle" | "watching" | "error">("idle"); const [error, setError] = useState(null); const start = async () => { try { setError(null); await window.aeBridge?.startWatcher(dir); setStatus("watching"); } catch (e) { const message = e instanceof Error ? e.message : "Failed to start watcher"; setError(message); setStatus("error"); } }; const stop = async () => { try { setError(null); await window.aeBridge?.stopWatcher(); setStatus("idle"); } catch (e) { const message = e instanceof Error ? e.message : "Failed to stop watcher"; setError(message); } }; return (
AeThex Overlay
📂 File Watcher
setDir(e.target.value)} placeholder="Enter folder path..." style={{ width: "100%", padding: 10, borderRadius: 8, border: "1px solid #1f2937", background: "#0f172a", color: "#e5e7eb", marginBottom: 12, fontSize: 13, }} />
{status === "watching" ? "Watching for changes..." : status === "error" ? "Error" : "Idle"}
{error && (
{error}
)}
PII is scrubbed locally before processing
); }