2022-01-20 21:36:17 +00:00
|
|
|
export const indicators = {
|
|
|
|
GRAY: 'grey',
|
|
|
|
GREY: 'grey',
|
|
|
|
BLUE: 'blue',
|
|
|
|
RED: 'red',
|
|
|
|
GREEN: 'green',
|
|
|
|
ORANGE: 'orange',
|
|
|
|
PURPLE: 'purple',
|
|
|
|
YELLOW: 'yellow',
|
|
|
|
BLACK: 'black',
|
|
|
|
};
|
|
|
|
|
2022-01-19 10:11:49 +00:00
|
|
|
export const statusColor = {
|
|
|
|
Draft: 'gray',
|
|
|
|
Unpaid: 'orange',
|
|
|
|
Paid: 'green',
|
|
|
|
Cancelled: 'red',
|
|
|
|
};
|
|
|
|
|
|
|
|
const getValidColor = (color) => {
|
|
|
|
const isValid = ['gray', 'orange', 'green', 'red', 'yellow', 'blue'].includes(
|
|
|
|
color
|
|
|
|
);
|
|
|
|
return isValid ? color : 'gray';
|
|
|
|
};
|
|
|
|
|
|
|
|
export function getBgColorClass(color) {
|
|
|
|
return `bg-${getValidColor(color)}-100`;
|
|
|
|
}
|
2022-02-03 10:55:21 +00:00
|
|
|
|
|
|
|
export function getColorClass(color, type, value = 300) {
|
|
|
|
return `${type}-${getValidColor(color)}-${value}`;
|
|
|
|
}
|
|
|
|
|
2022-01-19 10:11:49 +00:00
|
|
|
export function getTextColorClass(color) {
|
|
|
|
return `text-${getValidColor(color)}-600`;
|
|
|
|
}
|
|
|
|
|
2022-02-03 10:55:21 +00:00
|
|
|
export function getBgTextColorClass(color) {
|
2022-01-19 10:11:49 +00:00
|
|
|
const bg = getBgColorClass(color);
|
|
|
|
const text = getTextColorClass(color);
|
|
|
|
return [bg, text].join(' ');
|
|
|
|
}
|