@hypernetlabs/web-ui
Version:
Web ui react components for hypernet protocol
42 lines • 1.64 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GovernanceChip = void 0;
const react_1 = __importDefault(require("react"));
const core_1 = require("@material-ui/core");
const GovernanceChip_style_1 = require("../../components/GovernanceChip/GovernanceChip.style");
const theme_1 = require("../../theme");
const GovernanceChip = (props) => {
const { label, color = "gray", className, ...rest } = props;
const colorCodes = getChipColorCodes(color);
const classes = (0, GovernanceChip_style_1.useStyles)(colorCodes);
return (react_1.default.createElement(core_1.Chip, { className: `${classes.chip} ${className}`, label: label, ...rest }));
};
exports.GovernanceChip = GovernanceChip;
const getChipColorCodes = (type) => {
switch (type) {
case "blue":
return {
backgroundColor: theme_1.colors.BLUE100,
color: theme_1.colors.BLUE700,
};
case "green":
return {
backgroundColor: theme_1.colors.GREEN100,
color: theme_1.colors.GREEN700,
};
case "orange":
return {
backgroundColor: theme_1.colors.ORANGE100,
color: theme_1.colors.ORANGE700,
};
case "gray":
return {
backgroundColor: theme_1.colors.GRAY200,
color: theme_1.colors.GRAY500,
};
}
};
//# sourceMappingURL=GovernanceChip.js.map