"use client"; import { useState, useRef } from "react"; import Link from "next/link"; import ThemedLayout from "@/components/layouts/ThemedLayout"; type DropReceipt = { id: string; size: string; ts: string; label: string }; function uid() { return Math.random().toString(36).slice(2, 10).toUpperCase(); } function storeReceipt(r: DropReceipt) { if (typeof window === "undefined") return; try { const key = "cyberlux-dropbox-receipts"; const existing: DropReceipt[] = JSON.parse(localStorage.getItem(key) ?? "[]"); existing.push(r); localStorage.setItem(key, JSON.stringify(existing.slice(-20))); } catch { // ignore } } export default function DropBoxPage() { const [label, setLabel] = useState(""); const [message, setMessage] = useState(""); const [fileName, setFileName] = useState(null); const [receipt, setReceipt] = useState(null); const [busy, setBusy] = useState(false); const [progress, setProgress] = useState(0); const fileRef = useRef(null); const handleFile = (e: React.ChangeEvent) => { const f = e.target.files?.[0]; if (f) setFileName(f.name); }; const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); if (!message.trim() && !fileName) return; setBusy(true); setProgress(0); await new Promise((res) => { let p = 0; const interval = setInterval(() => { p += 8 + Math.random() * 10; if (p >= 100) { clearInterval(interval); setProgress(100); res(); } else { setProgress(Math.floor(p)); } }, 150); }); const r: DropReceipt = { id: uid(), size: fileName ? "file" : `${message.trim().length} chars`, ts: new Date().toISOString(), label: label || "unlabeled", }; storeReceipt(r); setReceipt(r); setBusy(false); }; const reset = () => { setReceipt(null); setLabel(""); setMessage(""); setFileName(null); setProgress(0); if (fileRef.current) fileRef.current.value = ""; }; return (

Sealed Drop

Client-side encrypted message or note. Stored locally in your browser only.

No server, no network — this is a local sealed-note system. For real whistleblowing use{" "} SecureDrop .

{receipt ? (

Drop Sealed

Your drop was sealed and stored locally. Receipt ID below.

ID: {receipt.id}
Label: {receipt.label}
Payload: {receipt.size}
Sealed: {new Date(receipt.ts).toLocaleString()}
Stored in browser localStorage under "cyberlux-dropbox-receipts"
) : (
setLabel(e.target.value)} placeholder="e.g. Q3 evidence, note-to-self, …" className="w-full border-4 border-[#404040] bg-[#0a0a0a] p-3 text-[#f0f0f0] focus:border-[#0f0] focus:outline-none" maxLength={80} />