Files
Checkmate/client/src/Components/design-elements/Chip.tsx
T
2026-05-20 10:29:13 -07:00

31 lines
575 B
TypeScript

import MuiChip from "@mui/material/Chip";
import Typography from "@mui/material/Typography";
import { useTheme } from "@mui/material";
interface ChipProps {
text: string;
color?: string;
}
export const Chip = ({ text, color }: ChipProps) => {
const theme = useTheme();
const textColor = color
? theme.palette.getContrastText(color)
: theme.palette.text.primary;
return (
<MuiChip
size="small"
label={
<Typography
variant="body2"
color={textColor}
>
{text}
</Typography>
}
sx={{
backgroundColor: color,
}}
/>
);
};