Prepend each stratagem choice with "Option 1", "Option 2", etc., to clearly indicate the available options for users. This change enhances the user experience by making the choices more explicit.
[skip gpt_engineer]
Этот коммит содержится в:
gpt-engineer-app[bot] 2024-12-15 15:17:19 +00:00
родитель 92a18d534b
Коммит c0cba2f4b9
2 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -10,13 +10,15 @@ interface ChoiceCardProps {
previousChoices: string[]; previousChoices: string[];
onClick: () => void; onClick: () => void;
disabled?: boolean; disabled?: boolean;
optionNumber: number;
} }
export const ChoiceCard: React.FC<ChoiceCardProps> = ({ export const ChoiceCard: React.FC<ChoiceCardProps> = ({
choice, choice,
previousChoices, previousChoices,
onClick, onClick,
disabled = false disabled = false,
optionNumber
}) => { }) => {
const strengtheningChoices = choice.strengthenedBy?.filter(c => previousChoices.includes(c)) || []; const strengtheningChoices = choice.strengthenedBy?.filter(c => previousChoices.includes(c)) || [];
const weakeningChoices = choice.weakenedBy?.filter(c => previousChoices.includes(c)) || []; const weakeningChoices = choice.weakenedBy?.filter(c => previousChoices.includes(c)) || [];
@ -45,6 +47,7 @@ export const ChoiceCard: React.FC<ChoiceCardProps> = ({
<CardHeader className="space-y-1"> <CardHeader className="space-y-1">
<div className="flex justify-between items-start"> <div className="flex justify-between items-start">
<CardTitle className="text-lg"> <CardTitle className="text-lg">
<span className="text-yellow-500 mr-2">Option {optionNumber}:</span>
{choice.text} {choice.text}
</CardTitle> </CardTitle>
<div className="flex gap-2"> <div className="flex gap-2">
@ -112,4 +115,4 @@ export const ChoiceCard: React.FC<ChoiceCardProps> = ({
</CardContent> </CardContent>
</Card> </Card>
); );
}; };

Просмотреть файл

@ -395,13 +395,14 @@ const Index = () => {
</div> </div>
</CardHeader> </CardHeader>
<CardContent className="space-y-4"> <CardContent className="space-y-4">
{currentStageData.choices.map((choice) => ( {currentStageData.choices.map((choice, index) => (
<ChoiceCard <ChoiceCard
key={choice.id} key={choice.id}
choice={choice} choice={choice}
previousChoices={previousChoices} previousChoices={previousChoices}
onClick={() => handleStrategyClick(choice)} onClick={() => handleStrategyClick(choice)}
disabled={showingResult || isLoading} disabled={showingResult || isLoading}
optionNumber={index + 1}
/> />
))} ))}
</CardContent> </CardContent>