import { FC } from 'react' import styled from 'styled-components' import { HighlightedText } from '../../../styles/Global' import { theme } from '../../../styles/Theme' interface RightAnswerProps { correctAnswers: string[] choices: string[] } const RightAnswerContainer = styled.p` font-size: 18px; font-weight: 400; color: ${({ theme }) => theme.colors.darkerGray}; margin-top: 15px; line-height: 1.2; ` const RightAnswer: FC = ({ correctAnswers, choices }) => { return ( {`Right ${correctAnswers.length < 2 ? 'Answer' : 'Answers'}: `} {correctAnswers.map((item: string, index: number) => { const label = String.fromCharCode(65 + choices.indexOf(item)) return ( {`${label} (${item})${index !== correctAnswers.length - 1 ? ', ' : ''}`} ) })} ) } export default RightAnswer