Added status label, fixed JSdoc

This commit is contained in:
Alex Holliday committed 2024-05-07 14:22:39 -07:00
1 parent f8828fe6e8
commit 6359fd52b6
7 files changed
+162 -67

No files matched your search

@@ -0,0 +1,42 @@
import PropTypes from "prop-types";
import BaseLabel from "./BaseLabel";
import { Box } from "@mui/material";
import { useTheme } from "@mui/material";
/**
* @component
* @param {Object} props
* @param {'Seen' | 'Waiting' | 'New' | 'Active'} props.status - The status for the label
* @returns {JSX.Element}
*/
const StatusLabel = ({ status }) => {
const theme = useTheme();
const colorLookup = {
Seen: theme.palette.labelGray.color,
Waiting: theme.palette.labelRed.color,
New: theme.palette.labelOrange.color,
Active: theme.palette.labelGreen.color,
};
const color = colorLookup[status] || theme.palette.labelGray.color;
return (
<BaseLabel label={status}>
<Box
width={12}
height={12}
bgcolor={color}
borderRadius="50%"
marginRight={1}
/>
</BaseLabel>
);
};
StatusLabel.propTypes = {
status: PropTypes.oneOf(["Seen", "Waiting", "New", "Active"]),
};
export default StatusLabel;