fix: improve multiselect for webhook triggers (#1795)

Replaces https://github.com/documenso/documenso/pull/1660 with the same
code but targeting our main branch.

## Demo

![CleanShot 2025-02-18 at 18 01
05](https://github.com/user-attachments/assets/5afeab95-1a80-4d54-b845-b32cb2e33266)
This commit is contained in:
Lucas Smith
2025-05-15 13:01:45 +10:00
committed by GitHub
parent 99b0ad574e
commit bd64ad9fef
3 changed files with 627 additions and 76 deletions
+15
View File
@@ -0,0 +1,15 @@
import React, { useEffect } from 'react';
export const useDebounce = <T>(value: T, delay?: number): T => {
const [debouncedValue, setDebouncedValue] = React.useState<T>(value);
useEffect(() => {
const timer = setTimeout(() => setDebouncedValue(value), delay || 500);
return () => {
clearTimeout(timer);
};
}, [value, delay]);
return debouncedValue;
};