import type { ConsultationStatus, ProjectProgram, ProjectSector, UserRole, } from '@/types'; export const sectorLabels: Record = { government: 'Pemerintahan', private: 'Swasta', soe: 'BUMN', }; export const programLabels: Record = { 'price-monitoring': 'Pemantauan Harga', investment: 'Investasi', erp: 'ERP', }; export const statusLabels: Record = { new: 'Baru', contacted: 'Dihubungi', closed: 'Selesai', }; export const statusBadgeClasses: Record = { new: 'bg-primary text-primary-foreground border-transparent', contacted: 'border-transparent bg-amber-100 text-amber-800 dark:bg-amber-500/20 dark:text-amber-300', closed: 'border-transparent bg-emerald-100 text-emerald-800 dark:bg-emerald-500/20 dark:text-emerald-300', }; export const sourceLabels = { home: 'Beranda', services: 'Jasa', contact: 'Kontak', } as const; export const roleLabels: Record = { admin: 'Admin', editor: 'Editor', }; /** `{ value, label }` pairs for a select, in declaration order. */ export function optionsOf(labels: Record) { return (Object.keys(labels) as T[]).map((value) => ({ value, label: labels[value], })); } export function formatDate(value: string, withTime = false): string { return new Intl.DateTimeFormat('id-ID', { dateStyle: 'medium', ...(withTime ? { timeStyle: 'short' } : {}), }).format(new Date(value)); }