import { useEffect } from "react"; // `redirectURL` is a fully-formed URL (e.g. a Prolific completion link) // or null. When null, the app stays on the thank-you screen. function ThankYouScreen({ message = "Thank you for your time!", redirectURL = null }) { useEffect(() => { if (redirectURL) { const timer = setTimeout(() => { window.location.href = redirectURL; }, 3000); return () => clearTimeout(timer); } }, [redirectURL]); return (

{message}

{redirectURL ? (

Redirecting in 3 seconds…

) : (

You may now close this tab.

)}
); } export default ThankYouScreen;