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

No files matched your search

+14
View File
@@ -218,3 +218,17 @@ export const instructionCodes: Record<string, string> = {
medication: 'Obat', medication: 'Obat',
material: 'BMHP', 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' import { twMerge } from 'tailwind-merge'
export interface SelectOptionType<T> { export interface SelectOptionType<T> {
value: string
label: string label: string
value: T code?: string
} }
export function cn(...inputs: ClassValue[]) { export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs)) return twMerge(clsx(inputs))
} }
export function mapToFlowbiteOptList(items: Record<string, string>): SelectOptionType<string>[] { export function mapToComboboxOptList(items: Record<string, string>): SelectOptionType<string>[] {
if (!items) { if (!items) {
return [] return []
} }
@@ -20,6 +21,7 @@ export function mapToFlowbiteOptList(items: Record<string, string>): SelectOptio
result.push({ result.push({
label: items[item] as string, label: items[item] as string,
value: item, value: item,
code: item,
}) })
}) })
return result return result