mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-22 21:14:18 +00:00
22 lines
608 B
JavaScript
22 lines
608 B
JavaScript
import React, { useContext } from "react"
|
|
import ContextRepositoryEditor from "../../contexts/ContextConditionEditor"
|
|
import Badge from "../base/Badge"
|
|
|
|
|
|
/**
|
|
* A {@link Badge} representing a {@link Condition}.
|
|
*
|
|
* @param condition - The {@link Condition} that this badge represents.
|
|
* @returns {JSX.Element}
|
|
* @constructor
|
|
*/
|
|
export default function BadgeCondition({ condition }) {
|
|
const { removeRawCondition } = useContext(ContextRepositoryEditor)
|
|
|
|
return (
|
|
<Badge
|
|
{...condition.display()}
|
|
onClickDelete={() => removeRawCondition(condition)}
|
|
/>
|
|
)
|
|
}
|