refactor(FE): Use Color type for badge color typings

This commit is contained in:
rstubryan
2026-02-02 11:10:58 +07:00
parent 3ca4b324d3
commit 85556c0db0
2 changed files with 7 additions and 21 deletions
@@ -33,6 +33,7 @@ import Badge from '@/components/Badge';
import StatusBadge from '@/components/helper/StatusBadge';
import CheckboxInput from '@/components/input/CheckboxInput';
import { useUiStore } from '@/stores/ui/ui.store';
import { Color } from '@/types/theme';
// ===== STATUS BADGE UTILITIES =====
const statusTextMap: Record<string, string> = {
@@ -48,10 +49,7 @@ const getStatusText = (status: string): string => {
return statusTextMap[status] || status;
};
const statusBadgeColorMap: Record<
string,
'success' | 'error' | 'neutral' | 'info' | 'warning'
> = {
const statusBadgeColorMap: Record<string, Color> = {
APPROVED: 'success',
Disetujui: 'success',
approved: 'success',
@@ -70,9 +68,7 @@ const statusBadgeColorMap: Record<
diperbarui: 'warning',
};
const getStatusBadgeColor = (
status: string
): 'success' | 'error' | 'neutral' | 'info' | 'warning' => {
const getStatusBadgeColor = (status: string): Color => {
return statusBadgeColorMap[status] || 'neutral';
};