import { House } from "lucide-react"; import { Button } from "@/components/ui/button"; import { useTranslation } from "@/hooks/useTranslation"; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from "@/components/ui/alert-dialog"; interface RoundHeaderProps { successfulRounds: number; onBack?: () => void; showConfirmDialog: boolean; setShowConfirmDialog: (show: boolean) => void; onCancel?: () => void; } export const RoundHeader = ({ successfulRounds, onBack, showConfirmDialog, setShowConfirmDialog, onCancel }: RoundHeaderProps) => { const t = useTranslation(); const handleHomeClick = () => { console.log("RoundHeader - Home button clicked, successful rounds:", successfulRounds); if (successfulRounds > 0) { console.log("RoundHeader - Setting showConfirmDialog to true"); setShowConfirmDialog(true); } else { console.log("RoundHeader - No successful rounds, navigating directly"); onBack?.(); } }; const handleDialogChange = (open: boolean) => { console.log("RoundHeader - Dialog state changing to:", open); setShowConfirmDialog(open); if (!open) { // Dialog is closing console.log("RoundHeader - Dialog closing, triggering navigation"); onBack?.(); } }; return (
{t.game.round} {successfulRounds + 1}

{t.game.title}

{t.game.leaveGameTitle} {t.game.leaveGameDescription} {t.game.cancel} {t.game.confirm}
); };