mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-03 05:29:12 +00:00
Show agent details card on hover on agent pill on web app home page
- Double click on agent to open edit agent card - Focus on chat input pane when agent selected/clicked for quick, smooth agent switch and message flow - Hover on agent to see agent detail card on non-mobile displays - Use debounce to only show when hover on card for a bit
This commit is contained in:
@@ -70,3 +70,19 @@ export function useIsMobileWidth() {
|
||||
|
||||
return isMobileWidth;
|
||||
}
|
||||
|
||||
export function useDebounce<T>(value: T, delay: number): T {
|
||||
const [debouncedValue, setDebouncedValue] = useState<T>(value);
|
||||
|
||||
useEffect(() => {
|
||||
const handler = setTimeout(() => {
|
||||
setDebouncedValue(value);
|
||||
}, delay);
|
||||
|
||||
return () => {
|
||||
clearTimeout(handler);
|
||||
};
|
||||
}, [value, delay]);
|
||||
|
||||
return debouncedValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user