import React from 'react'; // import { Glyphicon } from 'react-bootstrap'; import "./starRating.css"; interface StarRatingProps { stars: number } class StarRating extends React.Component { starText(stars: number) { var text = ''; switch (stars) { case 1: text = 'one star'; break; case 2: text = 'two stars'; break; case 3: text = 'three stars'; break; case 4: text = 'four stars'; break; case 5: text = 'five stars'; break; } return text; } render() { console.log(this.props.stars, this.starText(this.props.stars)) return (

{this.starText(this.props.stars)}

{/* = 1 ? "star" : "star-empty"} /> = 2 ? "star" : "star-empty"} /> = 3 ? "star" : "star-empty"} /> = 4 ? "star" : "star-empty"} /> = 5 ? "star" : "star-empty"} /> */}
); } } export default StarRating;