fixed bugs

This commit is contained in:
belviskhoremk
2026-02-22 23:25:10 +00:00
parent 53279e8fe1
commit f5d1bfb49d
10 changed files with 1073 additions and 834 deletions

View File

@@ -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' },
]
]