mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-22 21:14:18 +00:00
26 lines
792 B
JavaScript
26 lines
792 B
JavaScript
import React, { useContext } from "react"
|
|
import BoxFull from "../base/BoxFull"
|
|
import BadgeCondition from "./BadgeCondition"
|
|
import useRepositoryEditor from "../../hooks/useRepositoryEditor"
|
|
import ContextLanguage from "../../contexts/ContextLanguage"
|
|
|
|
|
|
/**
|
|
* A box which renders all conditions of the {@link RepositoryEditor} as {@link BadgeCondition}s.
|
|
*
|
|
* @param props
|
|
* @returns {JSX.Element}
|
|
* @constructor
|
|
*/
|
|
export default function BoxConditions({ ...props }) {
|
|
const { conditions } = useRepositoryEditor()
|
|
const { strings } = useContext(ContextLanguage)
|
|
|
|
const badges = conditions.map((cond, pos) => <BadgeCondition key={pos} condition={cond}/>)
|
|
|
|
return (
|
|
<BoxFull header={strings.conditions} {...props}>
|
|
{badges}
|
|
</BoxFull>
|
|
)
|
|
}
|