1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-26 15:04:18 +00:00
pds-2021-g2-nest/code/frontend/src/components/BoxWithHeader.js

28 lines
837 B
JavaScript
Raw Normal View History

import React from "react"
2021-04-20 23:03:59 +00:00
import Style from "./BoxWithHeader.module.css"
import classNames from "classnames"
/**
* A box with both a header and a body.
*
* @param header - The contents of the box header.
* @param children - The contents of the box body.
* @param className - Additional class(es) that should be added to the outer `<div>` of the box.
* @param props - Additional props to pass to the box.
* @returns {JSX.Element}
* @constructor
*/
export default function BoxWithHeader({ header, children, className, ...props }) {
2021-04-20 23:03:59 +00:00
return (
<div className={classNames(Style.BoxWithHeader, className)} {...props}>
<div className={Style.BoxHeader}>
{header}
2021-04-20 23:03:59 +00:00
</div>
<div className={Style.BoxBody}>
{children}
2021-04-20 23:03:59 +00:00
</div>
</div>
)
}