1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 04:54:18 +00:00

📔 Document Badge

This commit is contained in:
Steffo 2021-05-18 16:28:51 +02:00
parent bae0d9b5a5
commit 7903b5517a
Signed by: steffo
GPG key ID: 6965406171929D01
2 changed files with 13 additions and 1 deletions

View file

@ -5,6 +5,18 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import ButtonSmallX from "./ButtonSmallX" import ButtonSmallX from "./ButtonSmallX"
/**
* A small colored badge.
*
* @param icon - The icon that the badge should have on the left.
* @param color - The color that the badge should have.
* @param onClickDelete - The action to perform when the X button is clicked. If undefined, the X button won't be shown.
* @param children - The text of the badge.
* @param className - Additional class(es) to append to the badge.
* @param props - Additional props to pass to the badge.
* @returns {JSX.Element}
* @constructor
*/
export default function Badge({ icon, color, onClickDelete, children, className, ...props }) { export default function Badge({ icon, color, onClickDelete, children, className, ...props }) {
return ( return (
<div className={classNames(Style.Badge, Style[`Badge${color}`], className)} {...props}> <div className={classNames(Style.Badge, Style[`Badge${color}`], className)} {...props}>

View file

@ -23,7 +23,7 @@ const CONDITION_ICONS = {
/** /**
* A small colored badge representing a Condition for a filter. * A {@link Badge} representing a Condition for a filter.
* *
* @param condition - The Condition that this badge represents. * @param condition - The Condition that this badge represents.
* @returns {JSX.Element} * @returns {JSX.Element}