⚡ enhance (lib): adjust libs
This commit is contained in:
+4
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user