From 50a0f0240d7fef133eb5acc1bea2b1168b08e9db Mon Sep 17 00:00:00 2001 From: Factiven Date: Sun, 24 Dec 2023 13:03:54 +0700 Subject: migrate to typescript --- components/anime/mobile/reused/infoChip.js | 43 --------------------- components/anime/mobile/reused/infoChip.tsx | 58 +++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 43 deletions(-) delete mode 100644 components/anime/mobile/reused/infoChip.js create mode 100644 components/anime/mobile/reused/infoChip.tsx (limited to 'components/anime/mobile/reused') diff --git a/components/anime/mobile/reused/infoChip.js b/components/anime/mobile/reused/infoChip.js deleted file mode 100644 index 41def85..0000000 --- a/components/anime/mobile/reused/infoChip.js +++ /dev/null @@ -1,43 +0,0 @@ -import React from "react"; -import { getFormat } from "../../../../utils/getFormat"; - -export default function InfoChip({ info, color, className }) { - return ( -
- {info?.episodes && ( -
- {info?.episodes} Episodes -
- )} - {info?.averageScore && ( -
- {info?.averageScore}% -
- )} - {info?.format && ( -
- {getFormat(info?.format)} -
- )} - {info?.status && ( -
- {info?.status} -
- )} -
- ); -} diff --git a/components/anime/mobile/reused/infoChip.tsx b/components/anime/mobile/reused/infoChip.tsx new file mode 100644 index 0000000..80ebf83 --- /dev/null +++ b/components/anime/mobile/reused/infoChip.tsx @@ -0,0 +1,58 @@ +import React, { CSSProperties, FC } from "react"; +import { getFormat } from "@/utils/getFormat"; + +interface Info { + episodes?: number; + averageScore?: number; + format?: string; + status?: string; +} + +interface InfoChipProps { + info: Info; + color: any; + className: string; +} + +const InfoChip: FC = ({ info, color, className }) => { + return ( +
+ {info?.episodes && ( +
+ {info?.episodes} Episodes +
+ )} + {info?.averageScore && ( +
+ {info?.averageScore}% +
+ )} + {info?.format && ( +
+ {getFormat(info?.format)} +
+ )} + {info?.status && ( +
+ {info?.status} +
+ )} +
+ ); +}; + +export default InfoChip; -- cgit v1.2.3