@cimpress/react-components
Version:
React components to support the MCP styleguide
25 lines • 1.31 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SortIndicator = void 0;
const react_1 = __importDefault(require("react"));
const SortIndicatorDownSvg_1 = __importDefault(require("../../icons/SortIndicatorDownSvg"));
const SortIndicatorUpSvg_1 = __importDefault(require("../../icons/SortIndicatorUpSvg"));
const SortIndicatorSvg_1 = __importDefault(require("../../icons/SortIndicatorSvg"));
const colors_1 = require("../../colors");
const SortIndicator = ({ currentSort, accessor }) => {
const iStyle = {
marginLeft: '5px',
};
if (currentSort && currentSort.key === accessor) {
if (currentSort && currentSort.desc) {
return react_1.default.createElement(SortIndicatorUpSvg_1.default, { size: "8", color: colors_1.shale, style: iStyle });
}
return react_1.default.createElement(SortIndicatorDownSvg_1.default, { size: "8", color: colors_1.shale, style: iStyle });
}
return react_1.default.createElement(SortIndicatorSvg_1.default, { size: "8", color: colors_1.slate, style: iStyle });
};
exports.SortIndicator = SortIndicator;
//# sourceMappingURL=SortIndicator.js.map