"fix QuestionProgress component missing key props in button arrays,"

This commit is contained in:
louiscklaw
2025-05-11 07:55:37 +08:00
parent b5e9c8ba34
commit e62dc5f597

View File

@@ -12,12 +12,12 @@ const QuestionProgress: React.FC<ContainerProps> = ({ num_rating = 0, num_full_r
<>
<div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', gap: '0.15rem' }}>
{Array.from({ length: num_rating }, (_, index) => (
<IonButton shape="round" fill="outline" size="small" color="success">
<IonButton key={index} shape="round" fill="outline" size="small" color="success">
<IonIcon slot="icon-only" icon={checkmarkOutline}></IonIcon>
</IonButton>
))}
{Array.from({ length: num_full_rating - num_rating }, (_, index) => (
<IonButton shape="round" fill="outline" size="small" color="medium">
<IonButton key={index} shape="round" fill="outline" size="small" color="medium">
<IonIcon slot="icon-only"></IonIcon>
</IonButton>
))}