mirror of
http://88.130.71.182:3000/BlitTech/contexta_fe.git
synced 2026-06-13 08:21:22 +00:00
fixed bugs
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { type ClassValue, clsx } from 'clsx'
|
||||
import { twMerge } from 'tailwind-merge'
|
||||
import { useState, useEffect, useRef } from 'react'
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
@@ -58,6 +59,18 @@ export function getPlanColor(plan: string): string {
|
||||
return colors[plan] || colors.free
|
||||
}
|
||||
|
||||
// IMP-07: Debounce hook for search inputs (300ms default)
|
||||
export function useDebounce<T>(value: T, delay: number = 300): T {
|
||||
const [debouncedValue, setDebouncedValue] = useState<T>(value)
|
||||
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => setDebouncedValue(value), delay)
|
||||
return () => clearTimeout(timer)
|
||||
}, [value, delay])
|
||||
|
||||
return debouncedValue
|
||||
}
|
||||
|
||||
export const AVAILABLE_MODELS = [
|
||||
{
|
||||
id: 'accounts/fireworks/models/llama-v3p1-70b-instruct',
|
||||
@@ -133,4 +146,4 @@ export const LANGUAGES = [
|
||||
{ code: 'it', name: 'Italian' }, { code: 'pt', name: 'Portuguese' },
|
||||
{ code: 'ja', name: 'Japanese' }, { code: 'ko', name: 'Korean' },
|
||||
{ code: 'zh', name: 'Chinese' }, { code: 'ar', name: 'Arabic' },
|
||||
]
|
||||
]
|
||||
Reference in New Issue
Block a user