diff --git a/app/lib/constants.ts b/app/lib/constants.ts index d904a87e..866fc520 100644 --- a/app/lib/constants.ts +++ b/app/lib/constants.ts @@ -218,3 +218,17 @@ export const instructionCodes: Record = { medication: 'Obat', material: 'BMHP', } + +export const relationshipCodes: Record = { + mother: 'Ibu', + father: 'Ayah', + uncle: 'Paman', + aunt: 'Bibi', + sibling: 'Saudara', + 'gd-mother': 'Nenek', + 'gd-father': 'Kakek', + child: 'Anak', + nephew: 'Keponakan', + 'gd-child': 'Cucu', + other: 'Lainnya', +} diff --git a/app/lib/utils.ts b/app/lib/utils.ts index 59afb775..c6098e1b 100644 --- a/app/lib/utils.ts +++ b/app/lib/utils.ts @@ -3,15 +3,16 @@ import { clsx } from 'clsx' import { twMerge } from 'tailwind-merge' export interface SelectOptionType { + value: string label: string - value: T + code?: string } export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)) } -export function mapToFlowbiteOptList(items: Record): SelectOptionType[] { +export function mapToComboboxOptList(items: Record): SelectOptionType[] { if (!items) { return [] } @@ -20,6 +21,7 @@ export function mapToFlowbiteOptList(items: Record): SelectOptio result.push({ label: items[item] as string, value: item, + code: item, }) }) return result