Files
Checkmate/Client/src/Components/StatusBoxes/skeleton.jsx
T

33 lines
693 B
React
Raw Normal View History

import { Stack, Skeleton } from "@mui/material";
import { useTheme } from "@emotion/react";
import PropTypes from "prop-types";
2025-01-31 13:43:28 -08:00
const SkeletonLayout = ({ numBoxes, flexWrap }) => {
const theme = useTheme();
return (
<Stack
direction="row"
2025-01-31 13:43:28 -08:00
flexWrap={flexWrap}
gap={theme.spacing(4)}
mt={theme.spacing(4)}
>
{Array.from({ length: numBoxes }).map((_, index) => {
2025-01-31 13:43:28 -08:00
const width = `${200 / numBoxes}%`;
return (
<Skeleton
variant="rounded"
width={width}
2025-01-31 13:43:28 -08:00
height={100}
key={index}
/>
);
})}
</Stack>
);
};
SkeletonLayout.propTypes = {
2025-01-31 13:43:28 -08:00
flexWrap: PropTypes.string,
numBoxes: PropTypes.number,
};
export default SkeletonLayout;