c3lf-system-3/web/src/utils.js

27 lines
633 B
JavaScript
Raw Normal View History

2024-01-02 16:46:34 +00:00
function ticketStateColorLookup(ticket) {
if (ticket.startsWith('closed_')) {
return 'secondary';
}
if (ticket.startsWith('pending_')) {
return 'warning';
}
if (ticket.startsWith('waiting_')) {
return 'primary';
}
return 'danger';
}
function ticketStateIconLookup(ticket) {
if (ticket.startsWith('closed_')) {
return 'check';
}
if (ticket.startsWith('pending_')) {
return 'exclamation';
}
if (ticket.startsWith('waiting_')) {
return 'hourglass';
}
return 'exclamation';
}
export {ticketStateColorLookup, ticketStateIconLookup};