bananas-commerce-admin
Version:
What's this, an admin for apes?
26 lines • 977 B
JavaScript
import React from "react";
import CancelIcon from "@mui/icons-material/Cancel";
import CheckCircleIcon from "@mui/icons-material/CheckCircle";
import WarningIcon from "@mui/icons-material/Warning";
import Chip from "../Chip";
// TODO Logic for picking icon
export const CardPill = ({ label, color, icon, size = "small", variant, }) => {
let resolvedIcon;
if (icon === undefined) {
if (color === "success") {
resolvedIcon = React.createElement(CheckCircleIcon, null);
}
else if (color === "warning") {
resolvedIcon = React.createElement(WarningIcon, null);
}
else {
resolvedIcon = React.createElement(CancelIcon, null);
}
}
else {
resolvedIcon = icon ?? undefined;
}
return (React.createElement(Chip, { color: color ?? "success", icon: resolvedIcon, label: label, size: size, variant: variant }));
};
export default CardPill;
//# sourceMappingURL=CardPill.js.map