Files
Checkmate/client/src/Pages/Infrastructure/Details/Components/AreaChartBoxes/InfraAreaChart.jsx
T

37 lines
999 B
React
Raw Normal View History

2025-01-31 13:43:57 -08:00
// Components
import { Typography } from "@mui/material";
2025-09-25 10:11:41 -07:00
import BaseContainer from "../BaseContainer/index.jsx";
2025-09-27 14:54:55 -07:00
import AreaChart from "@/Components/v1/Charts/AreaChart/index.jsx";
2025-01-31 13:43:57 -08:00
// Utils
import { useTheme } from "@emotion/react";
2025-09-25 10:11:41 -07:00
import { useHardwareUtils } from "../../Hooks/useHardwareUtils.jsx";
2025-01-31 13:43:57 -08:00
const InfraAreaChart = ({ config }) => {
const theme = useTheme();
const { getDimensions } = useHardwareUtils();
return (
<BaseContainer>
<Typography
component="h2"
padding={theme.spacing(8)}
>
{config.heading}
</Typography>
<AreaChart
height={getDimensions().areaChartHeight}
data={config.data}
dataKeys={config.dataKeys}
xKey="_id"
yDomain={config.yDomain}
customTooltip={config.toolTip}
xTick={config.xTick}
yTick={config.yTick}
strokeColor={config.strokeColor}
gradient={true}
gradientStartColor={config.gradientStartColor}
gradientEndColor="#ffffff"
/>
</BaseContainer>
);
};
export default InfraAreaChart;