import { useTranslation } from "react-i18next"; import tw from "twin.macro"; import "styled-components/macro"; import { ComponentProps, forwardRef } from "react"; export const Badge = forwardRef(({ color, text, ...props }, ref) => { const colors = { yellow: tw`bg-yellow-500`, gray: tw`bg-gray-500`, red: tw`bg-red-700`, }; const realColor = (typeof (color) === "string" && color in colors) ? colors[color] : color; return (

{text}

); });