File size: 755 Bytes
f888423
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24


function getClassName(genre) {
    const classMap = {
      "children": "children-color",
      "fantasy": "fantasy-color",
      "history_biography": "history_biography-color",
      "graphic_comics": "comics-color",
      "romance": "romance-color",
      "poetry": "poetry-color",
      "ya": "YA-color",
      "crime": "crime-color"
    };
    return classMap[genre.toLowerCase().trim()] || "default_color"; // Use toLowerCase for case-insensitivity
  }


export const GenreTag = (props) => {
    return (
      <div className={getClassName(props.genre) + " book-card__info-section__genre-section-container" + " flex-center"}>
        <span className='book-card__info-section__genre-section-conteiner-text'>#{props.genre}</span>
      </div>
    )
}