add new chip component
This commit is contained in:
1 parent
e6a0f89c68
commit
5a187cd1c9
3 files changed
+36
No files matched your search
@@ -0,0 +1,30 @@
|
|||||||
|
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,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -27,3 +27,4 @@ export * from "./OfflineBanner";
|
|||||||
export * from "./Avatar";
|
export * from "./Avatar";
|
||||||
export * from "./StatusCodeLabel";
|
export * from "./StatusCodeLabel";
|
||||||
export * from "./StrategyBadge";
|
export * from "./StrategyBadge";
|
||||||
|
export * from "./Chip";
|
||||||
@@ -41,6 +41,11 @@ export const getMenu = (t: Function) => {
|
|||||||
path: "notifications",
|
path: "notifications",
|
||||||
icon: <Icon icon={Bell} />,
|
icon: <Icon icon={Bell} />,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: t("components.sidebar.menu.notifications"),
|
||||||
|
path: "tags",
|
||||||
|
icon: <Icon icon={Bell} />,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: t("components.sidebar.menu.checks"),
|
name: t("components.sidebar.menu.checks"),
|
||||||
path: "checks",
|
path: "checks",
|
||||||
|
|||||||
Reference in new issue
Block a user