2025-02-23 16:03:38 -05:00
|
|
|
import PropTypes from "prop-types";
|
|
|
|
|
import { useTheme } from "@emotion/react";
|
|
|
|
|
import { Box, Stack, Typography } from "@mui/material";
|
|
|
|
|
import { RowContainer } from "../StandardContainer";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
|
|
*
|
|
|
|
|
* @component
|
|
|
|
|
* @example
|
|
|
|
|
*
|
|
|
|
|
* @param {string} props.headerText - Header text
|
|
|
|
|
* @param {number} props.headerLevel - Font characteristic of the header
|
|
|
|
|
* @param {string} props.subHeaderText - Subheader text
|
|
|
|
|
* @param {number} props.subHeaderLevel - Font characteristic of the subheader
|
|
|
|
|
* @param {string} props.rightCatagoryTitle - Message for right section
|
|
|
|
|
* @param {number} props.rightCatagoryTitleLevel - Font characteristic of the right section header
|
|
|
|
|
* @param {string} props.rightDescription - Description for right section
|
|
|
|
|
* @param {number} props.rightDescriptionLevel - Font characteristic of the right section description
|
|
|
|
|
* @returns {JSX.Element} The rendered component
|
|
|
|
|
*/
|
|
|
|
|
|
2025-02-23 17:47:02 -08:00
|
|
|
const SubHeader = ({
|
|
|
|
|
headerText,
|
|
|
|
|
headerLevel = 1,
|
|
|
|
|
subHeaderText,
|
|
|
|
|
subHeaderLevel = 1,
|
|
|
|
|
rightCatagoryTitle,
|
|
|
|
|
rightCatagoryTitleLevel = 2,
|
|
|
|
|
rightDescription,
|
|
|
|
|
rightDescriptionLevel = 2,
|
|
|
|
|
}) => {
|
2025-02-23 16:03:38 -05:00
|
|
|
const theme = useTheme();
|
2025-02-23 17:47:02 -08:00
|
|
|
|
2025-02-23 16:03:38 -05:00
|
|
|
return (
|
2025-02-23 17:47:02 -08:00
|
|
|
<Stack
|
|
|
|
|
direction="row"
|
2025-02-23 16:03:38 -05:00
|
|
|
justifyContent="space-between"
|
2025-02-23 17:47:02 -08:00
|
|
|
>
|
|
|
|
|
<Stack direction={"column"}>
|
2025-02-23 16:03:38 -05:00
|
|
|
<Typography
|
|
|
|
|
component={`h${headerLevel}`}
|
|
|
|
|
variant={`h${headerLevel}`}
|
|
|
|
|
mb={theme.spacing(1)}
|
|
|
|
|
>
|
|
|
|
|
<Typography
|
|
|
|
|
component="span"
|
|
|
|
|
fontSize="inherit"
|
|
|
|
|
color={theme.palette.primary.contrastTextTertiary}
|
|
|
|
|
>
|
|
|
|
|
{headerText}
|
|
|
|
|
</Typography>
|
|
|
|
|
</Typography>
|
|
|
|
|
<Typography
|
|
|
|
|
variant={`body${subHeaderLevel}`}
|
|
|
|
|
color={theme.palette.primary.contrastTextTertiary}
|
|
|
|
|
>
|
|
|
|
|
{subHeaderText}
|
|
|
|
|
</Typography>
|
|
|
|
|
</Stack>
|
2025-02-23 17:47:02 -08:00
|
|
|
|
|
|
|
|
{rightCatagoryTitle && (
|
2025-02-23 16:03:38 -05:00
|
|
|
<RowContainer sx={{ width: "20%" }}>
|
|
|
|
|
<Stack>
|
2025-02-23 17:47:02 -08:00
|
|
|
<Typography variant={`body${rightCatagoryTitleLevel}`}>
|
|
|
|
|
{rightCatagoryTitle}
|
|
|
|
|
</Typography>
|
2025-02-23 16:03:38 -05:00
|
|
|
<Typography variant={`h${rightDescriptionLevel}`}>
|
|
|
|
|
{rightDescription}
|
|
|
|
|
</Typography>
|
|
|
|
|
</Stack>
|
|
|
|
|
</RowContainer>
|
2025-02-23 17:47:02 -08:00
|
|
|
)}
|
2025-02-23 16:03:38 -05:00
|
|
|
</Stack>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SubHeader.propTypes = {
|
2025-02-23 17:47:02 -08:00
|
|
|
headerText: PropTypes.string,
|
|
|
|
|
headerLevel: PropTypes.number,
|
|
|
|
|
subHeaderText: PropTypes.string,
|
|
|
|
|
subHeaderLevel: PropTypes.number,
|
|
|
|
|
rightCatagoryTitle: PropTypes.string,
|
|
|
|
|
rightCatagoryTitleLevel: PropTypes.number,
|
|
|
|
|
rightDescription: PropTypes.string,
|
|
|
|
|
rightDescriptionLevel: PropTypes.number,
|
2025-02-23 16:03:38 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default SubHeader;
|