refactor(FE): Add badge color helpers for status and weight

This commit is contained in:
rstubryan
2026-01-29 14:57:25 +07:00
parent d9a1d340bb
commit dada6a542f
@@ -25,6 +25,20 @@ export const getWeightStatusText = (status: string): string => {
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> = {
APPROVED: 'bg-[#00D39033]',
Disetujui: 'bg-[#00D39033]',
@@ -63,3 +77,29 @@ export const getStatusIndicatorColor = (status: string): string => {
export const getStatusText = (status: string): string => {
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';
};