import { useState } from "react"; import type React from "react"; import { Pencil } from "lucide-react"; interface OptionCardProps { title: string; options: string[]; selected: string; onSelect: (value: string) => void; customValue: string; onCustomChange: (value: string) => void; isShuffling: boolean; isVisible: boolean; playPopSound: () => void; playHoverSound: () => void; } const OptionCard: React.FC = ({ title, options, selected, onSelect, customValue, onCustomChange, isShuffling, isVisible, playPopSound, playHoverSound, }) => { const [isCustom, setIsCustom] = useState(false); const handleSelect = (option: string) => { playPopSound(); setIsCustom(false); onSelect(option); onCustomChange(""); }; const handleCustomClick = () => { playPopSound(); setIsCustom(true); onSelect(""); }; const shuffleClass = isShuffling ? "animate-shake" : ""; const visibilityClass = isVisible ? "animate-slide-in opacity-100" : "opacity-0 pointer-events-none"; return (

{title}

{options.map((option) => ( ))}
{isCustom && ( ) => { onCustomChange(e.target.value); onSelect(""); }} placeholder="Enter your own option..." className="mt-4 w-full p-3 border-2 border-black rounded-lg focus:outline-none focus:ring-2 focus:ring-yellow-400" /> )}
); }; export default OptionCard;