Files
Checkmate/client/src/Components/v1/InfoBox/index.jsx
T

42 lines
905 B
React
Raw Normal View History

2025-09-27 14:54:55 -07:00
import { RowContainer } from "../StandardContainer/index.jsx";
2025-02-20 19:00:06 -08:00
import { Stack, Typography } from "@mui/material";
2025-09-27 14:54:55 -07:00
import Image from "../Image/index.jsx";
2025-02-20 19:00:06 -08:00
import { useTheme } from "@mui/material/styles";
const InfoBox = ({
img,
icon: Icon,
alt,
heading,
headingLevel = 2,
subHeading,
subHeadingLevel = "",
sx,
}) => {
const theme = useTheme();
return (
<RowContainer sx={{ ...sx }}>
{img && (
<Image
src={img}
height={"30px"}
width={"30px"}
alt={alt}
sx={{ marginRight: theme.spacing(8) }}
/>
)}
{Icon && (
<Icon sx={{ width: "30px", height: "30px", marginRight: theme.spacing(8) }} />
)}
<Stack>
<Typography variant={`h${headingLevel}`}>{heading}</Typography>
<Typography variant={subHeadingLevel ? `h${subHeadingLevel}` : "body1"}>
{subHeading}
</Typography>
</Stack>
</RowContainer>
);
};
export default InfoBox;