@mikezimm/fps-library-v2
Version:
Library of reusable typescript/javascript functions, interfaces and constants
25 lines (23 loc) • 1.23 kB
JavaScript
/**
* CodeAnalizerComment: Updated 1 imports on 2024-09-22 14:49:52
* Update:: import { IAnySourceItem } to '@mikezimm/fps-core-v7/lib/components/molecules/AnyContent/IAnyContent;'
*/
/**
* CodeAnalizerComment: Updated 1 imports on 2024-09-21 23:07:24
* Update:: import { IAnySourceItem } to '@mikezimm/fps-core-v7/lib/components/molecules/AnyContent/IAnyContent;'
*/
import * as React from 'react';
export function createContentItemCount(item, CountType, thickPx = 25) {
const BaseStyles = {
position: 'absolute', opacity: '.4', zIndex: '1',
background: item.ItemCount > 4000 ? 'red' : item.ItemCount > 2000 ? 'yellow' : 'green',
};
const barSize = `${item.ItemCount / 5000 * 100}%`;
const TypeStyles = CountType === 'V' ?
{ height: barSize, bottom: '0px', left: '0px', width: `${thickPx}px` } :
{ width: barSize, bottom: '0px', left: '0px', height: `${thickPx}px` };
const ActualStyles = { ...TypeStyles, ...BaseStyles };
const itemCountBar = !item.ItemCount ? null : React.createElement("div", { title: `${item.ItemCount} Items`, style: ActualStyles }, " ");
return itemCountBar;
}
//# sourceMappingURL=createContentItemCount.js.map