import { useState } from "react"; export interface MoonCardProps { themeColor: string; status: "inProgress" | "executing" | "complete"; respond?: (response: string) => void; } export function MoonCard({ themeColor, status, respond }: MoonCardProps) { const [decision, setDecision] = useState<"launched" | "aborted" | null>(null); const handleLaunch = () => { setDecision("launched"); respond?.("You have permission to go to the moon."); }; const handleAbort = () => { setDecision("aborted"); respond?.( "You do not have permission to go to the moon. The user you're talking to rejected the request.", ); }; return (
{/* Show decision or prompt */} {decision === "launched" ? (
🌕

Mission Launched

We made it to the moon!

) : decision === "aborted" ? (

Mission Aborted

Staying on Earth 🌍

) : ( <>
🚀

Ready for Launch?

Mission to the Moon 🌕

{/* Launch Buttons */} {status === "executing" && (
)} )}
); }