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/interactive/BadgeCondition.js

23 lines
609 B
JavaScript
Raw Normal View History

import React, { useContext } from "react"
2021-04-29 14:58:31 +00:00
import ContextRepositoryEditor from "../../contexts/ContextRepositoryEditor"
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 }) {
2021-05-11 14:37:15 +00:00
const { removeRawCondition } = useContext(ContextRepositoryEditor)
return (
<Badge
{...condition.display()}
onClickDelete={() => removeRawCondition(condition)}
/>
)
}