import React from "react"; 
import okIcon from './icons/okIcon.svg';

type TProps = {
    title: string
    caption: string
    isSelected: boolean
    onClick: () => void
}

export const LangButton:React.FC<TProps> = React.memo((props) => {
    return <div className="lang-button-container">
        <div className="lang-button-text-part">
            <span className="lang-button-text-title">{props.title}</span>
            <span className="lang-button-text-caption">{props.caption}</span>
        </div>
        {
            props.isSelected
            ? <img className="lang-button-selected-icon" src={okIcon} alt='Текущий язык' />
            : null
        }
    </div>
})