enhance (lib): adjust libs

This commit is contained in:
Abizrh
2025-09-11 00:56:36 +07:00
parent 938278a7a2
commit 64d432f75a
2 changed files with 18 additions and 2 deletions
+14
View File
@@ -218,3 +218,17 @@ export const instructionCodes: Record<string, string> = {
medication: 'Obat',
material: 'BMHP',
}
export const relationshipCodes: Record<string, string> = {
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',
}
+4 -2
View File
@@ -3,15 +3,16 @@ import { clsx } from 'clsx'
import { twMerge } from 'tailwind-merge'
export interface SelectOptionType<T> {
value: string
label: string
value: T
code?: string
}
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
export function mapToFlowbiteOptList(items: Record<string, string>): SelectOptionType<string>[] {
export function mapToComboboxOptList(items: Record<string, string>): SelectOptionType<string>[] {
if (!items) {
return []
}
@@ -20,6 +21,7 @@ export function mapToFlowbiteOptList(items: Record<string, string>): SelectOptio
result.push({
label: items[item] as string,
value: item,
code: item,
})
})
return result