2021-04-29 14:58:31 +00:00
|
|
|
import React from "react"
|
|
|
|
import BoxFull from "../base/BoxFull"
|
|
|
|
import ConditionBadge from "./ConditionBadge"
|
|
|
|
import useRepositoryEditor from "../../hooks/useRepositoryEditor"
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A box which renders all conditions of the {@link RepositoryEditor} as {@link ConditionBadge}s.
|
|
|
|
*
|
|
|
|
* @param props
|
|
|
|
* @returns {JSX.Element}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
export default function BoxConditions({ ...props }) {
|
2021-05-11 14:37:15 +00:00
|
|
|
const { conditions } = useRepositoryEditor()
|
2021-04-29 14:58:31 +00:00
|
|
|
|
|
|
|
const badges = conditions.map((cond, pos) => <ConditionBadge key={pos} {...cond}/>)
|
|
|
|
|
|
|
|
return (
|
|
|
|
<BoxFull header={"Conditions"} {...props}>
|
|
|
|
{badges}
|
|
|
|
</BoxFull>
|
|
|
|
)
|
|
|
|
}
|