update shadcn/tailwind config

This commit is contained in:
padreug 2025-03-09 14:59:19 +01:00
parent 2a83972b47
commit 903636b6f9
9 changed files with 278 additions and 195 deletions

View file

@ -1,3 +1,5 @@
import type { Updater } from '@tanstack/vue-table'
import type { Ref } from 'vue'
import { type ClassValue, clsx } from 'clsx'
import { twMerge } from 'tailwind-merge'
@ -5,11 +7,9 @@ export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
export async function withTimeout<T>(promise: Promise<T>, timeoutMs: number = 10000): Promise<T> {
return Promise.race([
promise,
new Promise<T>((_, reject) =>
setTimeout(() => reject(new Error('Operation timed out')), timeoutMs)
)
])
export function valueUpdater<T extends Updater<any>>(updaterOrValue: T, ref: Ref) {
ref.value
= typeof updaterOrValue === 'function'
? updaterOrValue(ref.value)
: updaterOrValue
}