From 64d432f75a3a94e26ce2f6995a98e43bf884c021 Mon Sep 17 00:00:00 2001 From: Abizrh Date: Thu, 11 Sep 2025 00:56:36 +0700 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20enhance=20(lib):=20adjust=20libs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/constants.ts | 14 ++++++++++++++ app/lib/utils.ts | 6 ++++-- 2 files changed, 18 insertions(+), 2 deletions(-) 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