mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-26 00:05:45 +00:00
refactor(FE-438): Extract uniformity status and weight helpers
This commit is contained in:
@@ -15,36 +15,11 @@ import { UniformityDetail as UniformityDetailType } from '@/types/api/uniformity
|
||||
import { formatDate } from '@/lib/helper';
|
||||
import { useUiStore } from '@/stores/ui/ui.store';
|
||||
import UniformityDetailsPreview from './UniformityDetailsPreview';
|
||||
|
||||
const statusColorMap: Record<string, string> = {
|
||||
APPROVED: 'bg-[#00D39033]',
|
||||
REJECTED: 'bg-error/10',
|
||||
CREATED: 'bg-[#f3f3f4]',
|
||||
};
|
||||
|
||||
const statusIndicatorColorMap: Record<string, string> = {
|
||||
APPROVED: 'bg-[#008000]',
|
||||
REJECTED: 'bg-error',
|
||||
CREATED: 'bg-[#D9D9D9]',
|
||||
};
|
||||
|
||||
const statusTextMap: Record<string, string> = {
|
||||
APPROVED: 'Disetujui',
|
||||
REJECTED: 'Ditolak',
|
||||
CREATED: 'Pengajuan',
|
||||
};
|
||||
|
||||
const getStatusColor = (status: string): string => {
|
||||
return statusColorMap[status] || 'bg-info';
|
||||
};
|
||||
|
||||
const getStatusIndicatorColor = (status: string): string => {
|
||||
return statusIndicatorColorMap[status] || 'bg-info';
|
||||
};
|
||||
|
||||
const getStatusText = (status: string): string => {
|
||||
return statusTextMap[status] || status;
|
||||
};
|
||||
import {
|
||||
getStatusColor,
|
||||
getStatusIndicatorColor,
|
||||
getStatusText,
|
||||
} from '@/components/pages/uniformity/uniformity-utils';
|
||||
|
||||
export type DetailOptionType = OptionType & {
|
||||
id: string;
|
||||
|
||||
Reference in New Issue
Block a user