1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 21:14:18 +00:00
pds-2021-g2-nest/nest_frontend/components/base/Badge.js

28 lines
884 B
JavaScript

import React from "react"
import Style from "./Badge.module.css"
import classNames from "classnames"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import ButtonSmallX from "./ButtonSmallX"
export default function Badge({ icon, color, onClickDelete, children, className, ...props }) {
return (
<div className={classNames(Style.Badge, Style[`Badge${color}`], className)} {...props}>
<div className={Style.Icon}>
<FontAwesomeIcon icon={icon}/>
</div>
<div className={Style.Text}>
{children}
</div>
{
onClickDelete ?
<div>
<ButtonSmallX
onClick={onClickDelete}
/>
</div>
: null
}
</div>
)
}