import { useState } from "react"; import "./PasswordPrompt.css"; export default function PasswordPrompt({ onAuthenticated }) { const [password, setPassword] = useState(""); const handleSubmit = async (e) => { e.preventDefault(); const res = await fetch("/api/post/authenticate", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ password }), }); const data = await res.json(); if (res.ok) { onAuthenticated(); } else { alert(data.message); } }; return (