web/app/lib/utils.ts
Yoga Pangestu 2f79c83a17 feat: update sidebar button styles and add value updater utility function
- Adjusted sidebar menu button styles for improved icon size and padding.
- Increased default button height and text size for better accessibility.
- Introduced a new utility function `valueUpdater` to simplify state updates in components.
2026-07-24 10:45:35 +07:00

14 lines
404 B
TypeScript

import type { ClassValue } from "clsx"
import { clsx } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
export function valueUpdater<T>(updaterOrValue: T | ((old: T) => T), ref: { value: T }) {
ref.value = typeof updaterOrValue === 'function'
? (updaterOrValue as (old: T) => T)(ref.value)
: updaterOrValue
}