import React from "react"; import PropTypes from "prop-types"; function obterDificuldade(dadosFase) { // Usa a dificuldade da fase, se existir, senão calcula pelo número if (dadosFase?.dificuldade) { switch (dadosFase.dificuldade) { case "Fácil": return { nivel: "Fácil", cor: "bg-green-500", emoji: "😊" }; case "Médio": return { nivel: "Médio", cor: "bg-yellow-500", emoji: "🤔" }; case "Difícil": return { nivel: "Difícil", cor: "bg-orange-500", emoji: "😤" }; case "Extremo": return { nivel: "Extremo", cor: "bg-red-500", emoji: "🔥" }; default: return null; } } return null; } // English alias for migration const getDifficulty = (phaseData) => obterDificuldade(phaseData); function GameFaseInfo({ phaseData = {}, phaseNumber }) { const dificuldade = getDifficulty(phaseData); return (
{phaseData && phaseData.nome ? (
{/* Número da fase */}
{phaseNumber}
{/* Título/Subtítulo */}

{phaseData.nome}

{phaseData.descricao && (

{phaseData.descricao}

)}
{/* Dificuldade */}
{dificuldade && (
{dificuldade.emoji} {dificuldade.nivel}
)}
) : (
?

Selecione uma fase para começar

)}
); } export default GameFaseInfo; export { getDifficulty }; GameFaseInfo.propTypes = { };