@cimpress/react-components
Version:
React components to support the MCP styleguide
19 lines • 865 B
JavaScript
import React from 'react';
import SortIndicatorDownSvg from '../../icons/SortIndicatorDownSvg';
import SortIndicatorUpSvg from '../../icons/SortIndicatorUpSvg';
import SortIndicatorSvg from '../../icons/SortIndicatorSvg';
import { shale, slate } from '../../colors';
const SortIndicator = ({ currentSort, accessor }) => {
const iStyle = {
marginLeft: '5px',
};
if (currentSort && currentSort.key === accessor) {
if (currentSort && currentSort.desc) {
return React.createElement(SortIndicatorUpSvg, { size: "8", color: shale, style: iStyle });
}
return React.createElement(SortIndicatorDownSvg, { size: "8", color: shale, style: iStyle });
}
return React.createElement(SortIndicatorSvg, { size: "8", color: slate, style: iStyle });
};
export { SortIndicator };
//# sourceMappingURL=SortIndicator.js.map