mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-25 22:44:19 +00:00
📔 Document Badge
This commit is contained in:
parent
bae0d9b5a5
commit
7903b5517a
2 changed files with 13 additions and 1 deletions
|
@ -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}>
|
||||||
|
|
|
@ -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}
|
||||||
|
|
Loading…
Reference in a new issue