wip: init form entry education assessment
import clinical const from sheets wip: form entry add education assessment done: checkbox wip: add select Asesmen Kemampuan dan Kemauan Belajar
This commit is contained in:
+13
-1
@@ -7,6 +7,10 @@ export interface SelectOptionType<_T = string> {
|
||||
label: string
|
||||
code?: string
|
||||
}
|
||||
export interface CheckItem {
|
||||
id: string
|
||||
label: string
|
||||
}
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
@@ -27,6 +31,15 @@ export function mapToComboboxOptList(items: Record<string, string>): SelectOptio
|
||||
return result
|
||||
}
|
||||
|
||||
export function mapToCheckItems<T extends Record<string, string>, K extends keyof T & string>(
|
||||
items: T,
|
||||
): { id: K; label: T[K] }[] {
|
||||
return Object.entries(items).map(([key, value]) => ({
|
||||
id: key as K,
|
||||
label: value as T[K],
|
||||
}))
|
||||
}
|
||||
|
||||
/**
|
||||
* Mengkonversi string menjadi title case (huruf pertama setiap kata kapital)
|
||||
* @param str - String yang akan dikonversi
|
||||
@@ -36,7 +49,6 @@ export function toTitleCase(str: string): string {
|
||||
return str.toLowerCase().replace(/\b\w/g, (char) => char.toUpperCase())
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Menghitung umur berdasarkan tanggal lahir
|
||||
* @param birthDate - Tanggal lahir dalam format Date atau string
|
||||
|
||||
Reference in New Issue
Block a user