fix: harmonizar pesquisa e navegacao dos catalogos em QA
This commit is contained in:
@@ -113,9 +113,7 @@ export function ProvinceSelect({
|
||||
})
|
||||
.catch(() => {
|
||||
if (!controller.signal.aborted)
|
||||
setError(
|
||||
'Não foi possível concluir a pesquisa.',
|
||||
);
|
||||
setError('Não foi possível concluir a pesquisa.');
|
||||
})
|
||||
.finally(() => {
|
||||
if (!controller.signal.aborted) setLoading(false);
|
||||
@@ -130,7 +128,13 @@ export function ProvinceSelect({
|
||||
|
||||
return (
|
||||
<>
|
||||
<SearchState loading={loading} error={error} total={options.length} retry={() => setRetry(value => value + 1)} />
|
||||
<SearchState
|
||||
scope="Localizações"
|
||||
loading={loading}
|
||||
error={error}
|
||||
total={options.length}
|
||||
retry={() => setRetry((value) => value + 1)}
|
||||
/>
|
||||
<input
|
||||
className={className}
|
||||
aria-label={`Pesquisar ${label}`}
|
||||
@@ -300,9 +304,7 @@ export function TerritoryLevel({
|
||||
setMore(Boolean(data.next_page_url));
|
||||
} catch {
|
||||
if (!controller.signal.aborted)
|
||||
setError(
|
||||
'Não foi possível concluir a pesquisa.',
|
||||
);
|
||||
setError('Não foi possível concluir a pesquisa.');
|
||||
} finally {
|
||||
if (!controller.signal.aborted) setLoading(false);
|
||||
}
|
||||
@@ -314,7 +316,15 @@ export function TerritoryLevel({
|
||||
}, [index, parent, page, enabled, endpoint, retry, search]);
|
||||
return (
|
||||
<div className="space-y-2">
|
||||
{enabled && <SearchState loading={loading} error={error} total={options.length} retry={() => setRetry(value => value + 1)} />}
|
||||
{enabled && (
|
||||
<SearchState
|
||||
scope={labels[index]}
|
||||
loading={loading}
|
||||
error={error}
|
||||
total={options.length}
|
||||
retry={() => setRetry((value) => value + 1)}
|
||||
/>
|
||||
)}
|
||||
<label htmlFor={id} className="font-medium">
|
||||
{labels[index]}
|
||||
</label>
|
||||
|
||||
Reference in New Issue
Block a user