aboutsummaryrefslogtreecommitdiff
path: root/components/anime/mobile/reused/infoChip.js
blob: 41def858d8c9506f6488dd3cef8cbeda6ce31104 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import React from "react";
import { getFormat } from "../../../../utils/getFormat";

export default function InfoChip({ info, color, className }) {
  return (
    <div
      className={`flex-wrap w-full justify-start md:pt-1 gap-4 ${className}`}
    >
      {info?.episodes && (
        <div
          className={`dynamic-text rounded-md px-2 font-karla font-bold`}
          style={color}
        >
          {info?.episodes} Episodes
        </div>
      )}
      {info?.averageScore && (
        <div
          className={`dynamic-text rounded-md px-2 font-karla font-bold`}
          style={color}
        >
          {info?.averageScore}%
        </div>
      )}
      {info?.format && (
        <div
          className={`dynamic-text rounded-md px-2 font-karla font-bold`}
          style={color}
        >
          {getFormat(info?.format)}
        </div>
      )}
      {info?.status && (
        <div
          className={`dynamic-text rounded-md px-2 font-karla font-bold`}
          style={color}
        >
          {info?.status}
        </div>
      )}
    </div>
  );
}