Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function () {
const {
data,
isLoading,
error,
sendRequest,
} = useClientRequest((reqConfig) =>
client.getInstance().configurationGetAll(reqConfig)
)
const { t } = useTranslation()
const [filterValueLower, setFilterValueLower] = useState('')
const debouncedFilterValue = useDebounce(filterValueLower, { wait: 200 })
const handleSaved = useCallback(() => {
sendRequest()
}, [sendRequest])
const handleFilterChange = useCallback((e) => {
setFilterValueLower(e.target.value.toLowerCase())
}, [])
const errors = useMemo(() => {
if (error) {
return [error]
}
if (data?.errors) {
return data.errors
}