mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-22 21:14:18 +00:00
28 lines
884 B
JavaScript
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>
|
|
)
|
|
}
|