diff --git a/apps/dokploy/components/dashboard/project/add-template.tsx b/apps/dokploy/components/dashboard/project/add-template.tsx
index 8f4f792e..759c7ade 100644
--- a/apps/dokploy/components/dashboard/project/add-template.tsx
+++ b/apps/dokploy/components/dashboard/project/add-template.tsx
@@ -62,6 +62,7 @@ import {
HelpCircle,
LayoutGrid,
List,
+ Loader2,
PuzzleIcon,
SearchIcon,
} from "lucide-react";
@@ -99,7 +100,12 @@ export const AddTemplate = ({ projectId, baseUrl }: Props) => {
}
}, [customBaseUrl]);
- const { data } = api.compose.templates.useQuery(
+ const {
+ data,
+ isLoading: isLoadingTemplates,
+ error: errorTemplates,
+ isError: isErrorTemplates,
+ } = api.compose.templates.useQuery(
{ baseUrl: customBaseUrl },
{
enabled: open,
@@ -270,7 +276,20 @@ export const AddTemplate = ({ projectId, baseUrl }: Props) => {
)}
- {templates.length === 0 ? (
+ {isErrorTemplates && (
+