import {useState} from 'react';

const Review = ({title, rating, text}) => {
    const [showContent, setShowContent] = useState(false);

    return <div>
        <h3>{title} - {rating}/5</h3>
        {showContent ? <p>{text}</p> : <></>}
        <p onClick={() => setShowContent(showContent => !showContent)}>
            {showContent ? 'Show less' : 'Show more'}
        </p>
    </div>
}

export default Review;
