2021-04-23 00:18:06 +00:00
|
|
|
import React from "react"
|
2021-04-23 00:26:16 +00:00
|
|
|
import Style from "./BoxFull.module.css"
|
2021-04-20 23:03:59 +00:00
|
|
|
import classNames from "classnames"
|
|
|
|
|
|
|
|
|
2021-04-23 00:18:06 +00:00
|
|
|
/**
|
|
|
|
* A box with both a header and a body.
|
|
|
|
*
|
|
|
|
* @param header - The contents of the box header.
|
2021-04-23 17:07:50 +00:00
|
|
|
* @param headerClassName - Additional class(es) added to the inner `<div>` acting as the header.
|
|
|
|
* @param headerProps - Additional props passed to the inner `<div>` acting as the header.
|
2021-04-23 00:18:06 +00:00
|
|
|
* @param children - The contents of the box body.
|
2021-04-23 17:07:50 +00:00
|
|
|
* @param childrenClassName - Additional class(es) added to the inner `<div>` acting as the body.
|
|
|
|
* @param childrenProps - Additional props passed to the inner `<div>` acting as the body.
|
2021-04-23 00:18:06 +00:00
|
|
|
* @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
|
|
|
|
*/
|
2021-04-23 17:07:50 +00:00
|
|
|
export default function BoxFull(
|
|
|
|
{
|
|
|
|
header,
|
|
|
|
headerClassName,
|
|
|
|
headerProps,
|
|
|
|
children,
|
|
|
|
childrenClassName,
|
|
|
|
childrenProps,
|
|
|
|
className,
|
|
|
|
...props
|
|
|
|
}) {
|
|
|
|
|
2021-04-20 23:03:59 +00:00
|
|
|
return (
|
|
|
|
<div className={classNames(Style.BoxWithHeader, className)} {...props}>
|
2021-04-23 17:07:50 +00:00
|
|
|
<div className={classNames(Style.BoxHeader, headerClassName)} {...headerProps}>
|
2021-04-23 00:18:06 +00:00
|
|
|
{header}
|
2021-04-20 23:03:59 +00:00
|
|
|
</div>
|
2021-04-23 17:07:50 +00:00
|
|
|
<div className={classNames(Style.BoxBody, childrenClassName)} {...childrenProps}>
|
2021-04-23 00:18:06 +00:00
|
|
|
{children}
|
2021-04-20 23:03:59 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|