chore: import DH V2 D5.6.4 production baseline
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import type { SurveyCampaignStatus, SurveyTargetStatus } from '../../lib/api';
|
||||
|
||||
export const SURVEY_CAMPAIGN_STATUSES: Array<{ value: SurveyCampaignStatus; label: string }> = [
|
||||
{ value: 'DRAFT', label: 'Borrador' },
|
||||
{ value: 'PLANNED', label: 'Planificada' },
|
||||
{ value: 'IN_PROGRESS', label: 'En curso' },
|
||||
{ value: 'COMPLETED', label: 'Completada' },
|
||||
{ value: 'CANCELLED', label: 'Cancelada' },
|
||||
];
|
||||
|
||||
export const SURVEY_TARGET_STATUSES: Array<{ value: SurveyTargetStatus; label: string }> = [
|
||||
{ value: 'PENDING', label: 'Pendiente' },
|
||||
{ value: 'IN_PROGRESS', label: 'En ejecución' },
|
||||
{ value: 'SUBMITTED', label: 'En revisión' },
|
||||
{ value: 'COMPLETED', label: 'Completado' },
|
||||
{ value: 'SKIPPED', label: 'Omitido' },
|
||||
];
|
||||
|
||||
export function surveyCampaignStatusLabel(value: SurveyCampaignStatus): string {
|
||||
return SURVEY_CAMPAIGN_STATUSES.find((item) => item.value === value)?.label ?? value;
|
||||
}
|
||||
|
||||
export function surveyTargetStatusLabel(value: SurveyTargetStatus): string {
|
||||
return SURVEY_TARGET_STATUSES.find((item) => item.value === value)?.label ?? value;
|
||||
}
|
||||
|
||||
export function surveyStatusClass(value: SurveyCampaignStatus | SurveyTargetStatus): string {
|
||||
if (value === 'COMPLETED') return 'active';
|
||||
if (value === 'CANCELLED' || value === 'SKIPPED') return 'inactive';
|
||||
if (value === 'IN_PROGRESS' || value === 'SUBMITTED') return 'observed';
|
||||
return 'pending';
|
||||
}
|
||||
Reference in New Issue
Block a user