Updated names for uniformity

This commit is contained in:
Sean Edmunds
2025-04-28 14:21:45 -05:00
parent f44f6e004b
commit 19b793fbf9
26 changed files with 247 additions and 404 deletions

View File

@@ -27,10 +27,10 @@ const SearchProviderSettings = () => {
prefix: '',
};
const endpoint = 'api/providers';
const { data: providers, isFetched: providersIsFetched } = useQueryAPI({
const { data: providerData, isFetched: providerDataIsFetched } = useQueryAPI({
endpoint: endpoint,
});
const [providerData, setProviderData] = useState<Provider[]>([]);
const [providers, setProviders] = useState<Provider[]>([]);
const { isMobile } = useCommonHooks();
const { mutateAsync } = useMutationAPI();
const [newProvider, setNewProvider] = useState<Provider>(defaultProvider);
@@ -45,16 +45,16 @@ const SearchProviderSettings = () => {
};
useEffect(() => {
if (providers && providersIsFetched) {
setProviderData(
providers
if (providerData && providerDataIsFetched) {
setProviders(
providerData
.filter((a: Provider) =>
a.name.toLowerCase().includes(debouncedSearch.toLowerCase()),
)
.sort((a: Provider, b: Provider) => (a.prefix > b.prefix ? 1 : -1)),
);
}
}, [providers, providersIsFetched, debouncedSearch]);
}, [providerData, providerDataIsFetched, debouncedSearch]);
return (
<Stack>
@@ -138,16 +138,16 @@ const SearchProviderSettings = () => {
<SettingsHeader
setDragging={undefined}
openModal={openModal}
title={'Search Providers'}
title={'Search providerData'}
tooltip={{
title: 'Search providers and shortcuts can be configured here.',
highlightList: ['Providers', 'search', 'provider', 'prefix'],
title: 'Search providerData and shortcuts can be configured here.',
highlightList: ['providerData', 'search', 'provider', 'prefix'],
description:
'Providers can be used in the search bar. By starting a search with the prefix, it will be redirected to the url of the provider to complete the search.',
'providerData can be used in the search bar. By starting a search with the prefix, it will be redirected to the url of the provider to complete the search.',
}}
searchValue={searchValue}
setSearchValue={setSearchValue}
searchPlaceholder={'Search Search Providers...'}
searchPlaceholder={'Search Search providerData...'}
/>
<Stack
mt={isMobile ? '9rem' : '6rem'}
@@ -156,7 +156,7 @@ const SearchProviderSettings = () => {
align='center'
>
<Grid columns={18} w={'75%'}>
{providerData?.map((provider: Provider) => (
{providers?.map((provider: Provider) => (
<GridCol span={isMobile ? 18 : 6} key={provider.id}>
<Popover
withArrow