feat (employee): add based component & conditional form input

This commit is contained in:
Abizrh
2025-08-31 17:21:09 +07:00
parent 2b4ec07185
commit f9af69fd27
42 changed files with 1071 additions and 189 deletions
+19
View File
@@ -2,6 +2,25 @@ import type { ClassValue } from 'clsx'
import { clsx } from 'clsx'
import { twMerge } from 'tailwind-merge'
export interface SelectOptionType<T> {
label: string
value: T
}
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
export function mapToFlowbiteOptList(items: Record<string, string>): SelectOptionType<string>[] {
if (!items) {
return []
}
const result: SelectOptionType<string>[] = []
Object.keys(items).forEach((item) => {
result.push({
label: items[item] as string,
value: item,
})
})
return result
}