diff --git a/site/src/pages/TemplatesPage/TemplatesFilter.tsx b/site/src/pages/TemplatesPage/TemplatesFilter.tsx index 581858aabe9bf..f463a35ff5261 100644 --- a/site/src/pages/TemplatesPage/TemplatesFilter.tsx +++ b/site/src/pages/TemplatesPage/TemplatesFilter.tsx @@ -16,9 +16,13 @@ import type { FC } from "react"; interface TemplatesFilterProps { filter: ReturnType; + error?: unknown; } -export const TemplatesFilter: FC = ({ filter }) => { +export const TemplatesFilter: FC = ({ + filter, + error, +}) => { const organizationMenu = useFilterMenu({ onChange: (option) => filter.update({ ...filter.values, organization: option?.value }), @@ -48,6 +52,7 @@ export const TemplatesFilter: FC = ({ filter }) => { // learnMoreLink={docs("/templates#template-filtering")} isLoading={false} filter={filter} + error={error} options={ <> = ({ - - - {error ? ( + + {/* Validation errors are shown on the filter, other errors are an alert box. */} + {hasError(error) && !isApiValidationError(error) && ( - ) : ( - - - - - {Language.nameLabel} - - {showOrganizations ? "Organization" : Language.usedByLabel} - - {Language.buildTimeLabel} - {Language.lastUpdatedLabel} - - - - - {isLoading && } + )} - {isEmpty ? ( - +
+ + + {Language.nameLabel} + + {showOrganizations ? "Organization" : Language.usedByLabel} + + {Language.buildTimeLabel} + {Language.lastUpdatedLabel} + + + + + {isLoading && } + + {isEmpty ? ( + + ) : ( + templates?.map((template) => ( + - ) : ( - templates?.map((template) => ( - - )) - )} - -
-
- )} + )) + )} + + + ); }; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy