import { ImageIcon, LockIcon, QuestionIcon, StampIcon, TrayIcon, VaultIcon, } from "@phosphor-icons/react"; interface ToolBarProps { fileInputRef: React.RefObject; sealBtnClicked: boolean; setSealBtnClicked: (v: boolean) => void; onSave: (status: "SEALED" | "DRAFT" | "VAULT", date?: Date) => Promise; setConfirmModal: (v: "VAULT" | "SEAL" | null) => void; } export function ToolBar({ fileInputRef, sealBtnClicked, setSealBtnClicked, onSave, setConfirmModal, }: ToolBarProps) { return (
or
); } export function LetterHead() { return (
Sealed & View Only
); } interface VaultConfirmModalProps { onSave: (status: "SEALED" | "DRAFT" | "VAULT", date?: Date) => Promise; setConfirmModal: (v: "VAULT" | "SEAL" | null) => void; setUnlockDate: (d: Date | null) => void; } export function VaultConfirmModal({ onSave, setConfirmModal, setUnlockDate, }: VaultConfirmModalProps) { return (

Vault this letter?

Vaulting locks the letter permanently and will be{" "} mailed to you automatically on the unlock date.
You cannot edit or view the contents of the letter until then.

{ e.preventDefault(); const formData = new FormData(e.currentTarget); const unlockDateStr = formData.get("vault-date") as string; const newUnlockDate = new Date(unlockDateStr); setUnlockDate(newUnlockDate); await onSave("VAULT", newUnlockDate); setConfirmModal(null); }} id="vault-form" >
Set an unlock date
); }