diff --git a/ui/src/pages/api.tsx b/ui/src/pages/api.tsx index cde4a4d6..62fe0840 100644 --- a/ui/src/pages/api.tsx +++ b/ui/src/pages/api.tsx @@ -19,6 +19,7 @@ import { Server, ExternalLink, FileJson, + RefreshCw, } from 'lucide-react'; import { ProfileEditor } from '@/components/profile-editor'; import { ProfileCreateDialog } from '@/components/profile-create-dialog'; @@ -29,7 +30,7 @@ import { cn } from '@/lib/utils'; import { CopyButton } from '@/components/ui/copy-button'; export function ApiPage() { - const { data, isLoading } = useProfiles(); + const { data, isLoading, isError, refetch } = useProfiles(); const deleteMutation = useDeleteProfile(); const [selectedProfile, setSelectedProfile] = useState(null); const [searchQuery, setSearchQuery] = useState(''); @@ -111,6 +112,22 @@ export function ApiPage() { {isLoading ? (
Loading profiles...
+ ) : isError ? ( +
+
+ +
+

Failed to load profiles

+

+ Unable to fetch API profiles. Please try again. +

+
+ +
+
) : filteredProfiles.length === 0 ? (
{profiles.length === 0 ? (