mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 07:45:47 +00:00
refactor(FE): Add badge color helpers for status and weight
This commit is contained in:
@@ -25,6 +25,20 @@ export const getWeightStatusText = (status: string): string => {
|
|||||||
return weightStatusTextMap[status] || status;
|
return weightStatusTextMap[status] || status;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const weightStatusBadgeColorMap: Record<
|
||||||
|
string,
|
||||||
|
'success' | 'error' | 'neutral' | 'info'
|
||||||
|
> = {
|
||||||
|
ideal: 'success',
|
||||||
|
outside: 'error',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getWeightStatusBadgeColor = (
|
||||||
|
status: string
|
||||||
|
): 'success' | 'error' | 'neutral' | 'info' => {
|
||||||
|
return weightStatusBadgeColorMap[status] || 'neutral';
|
||||||
|
};
|
||||||
|
|
||||||
export const statusColorMap: Record<string, string> = {
|
export const statusColorMap: Record<string, string> = {
|
||||||
APPROVED: 'bg-[#00D39033]',
|
APPROVED: 'bg-[#00D39033]',
|
||||||
Disetujui: 'bg-[#00D39033]',
|
Disetujui: 'bg-[#00D39033]',
|
||||||
@@ -63,3 +77,29 @@ export const getStatusIndicatorColor = (status: string): string => {
|
|||||||
export const getStatusText = (status: string): string => {
|
export const getStatusText = (status: string): string => {
|
||||||
return statusTextMap[status] || status;
|
return statusTextMap[status] || status;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const statusBadgeColorMap: Record<
|
||||||
|
string,
|
||||||
|
'success' | 'error' | 'neutral' | 'info'
|
||||||
|
> = {
|
||||||
|
APPROVED: 'success',
|
||||||
|
Disetujui: 'success',
|
||||||
|
approved: 'success',
|
||||||
|
disetujui: 'success',
|
||||||
|
REJECTED: 'error',
|
||||||
|
Ditolak: 'error',
|
||||||
|
rejected: 'error',
|
||||||
|
ditolak: 'error',
|
||||||
|
CREATED: 'neutral',
|
||||||
|
Pengajuan: 'neutral',
|
||||||
|
created: 'neutral',
|
||||||
|
pengajuan: 'neutral',
|
||||||
|
PENDING: 'neutral',
|
||||||
|
pending: 'neutral',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getStatusBadgeColor = (
|
||||||
|
status: string
|
||||||
|
): 'success' | 'error' | 'neutral' | 'info' => {
|
||||||
|
return statusBadgeColorMap[status] || 'neutral';
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user