Skip to content

Commit b73b92d

Browse files
authored
feat: Add empty state component for catalog search results (#1110)
<img width="3302" height="2146" alt="CleanShot 2025-12-23 at 09 14 52@2x" src="https://github.com/user-attachments/assets/f9a1c18a-0732-4283-a071-bd765fb1788f" />
1 parent db652c2 commit b73b92d

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed

.changeset/flat-nails-confess.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"dashboard": patch
3+
---
4+
5+
Added empty state component for catalog search results

client/dashboard/src/pages/catalog/Catalog.tsx

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Page } from "@/components/page-layout";
22
import { Card } from "@/components/ui/card";
33
import { Dialog } from "@/components/ui/dialog";
4+
import { Heading } from "@/components/ui/heading";
45
import { Label } from "@/components/ui/label";
56
import { Skeleton } from "@/components/ui/skeleton";
67
import { Type } from "@/components/ui/type";
@@ -10,7 +11,7 @@ import { useRoutes } from "@/routes";
1011
import { useLatestDeployment } from "@gram/client/react-query";
1112
import { Badge, Button, Input, Stack } from "@speakeasy-api/moonshine";
1213
import { useMutation } from "@tanstack/react-query";
13-
import { CheckCircle, Loader2, Search } from "lucide-react";
14+
import { CheckCircle, Loader2, Search, SearchXIcon } from "lucide-react";
1415
import { useEffect, useMemo, useRef, useState } from "react";
1516
import { Outlet } from "react-router";
1617

@@ -274,11 +275,7 @@ export default function Catalog() {
274275
)}
275276

276277
{!isLoading && allServers?.length === 0 && (
277-
<div className="text-center py-12">
278-
<Type variant="subheading" className="text-muted-foreground">
279-
No MCP servers found matching "{searchQuery}"
280-
</Type>
281-
</div>
278+
<EmptySearchResult onClear={() => setSearchQuery("")} />
282279
)}
283280
</Stack>
284281
{addToProjectDialog}
@@ -289,6 +286,33 @@ export default function Catalog() {
289286
);
290287
}
291288

289+
function EmptySearchResult({ onClear }: { onClear: () => void }) {
290+
return (
291+
<div className="w-full flex items-center justify-center bg-background rounded-xl border-1 py-8">
292+
<Stack
293+
gap={1}
294+
className="w-full max-w-sm m-8"
295+
align="center"
296+
justify="center"
297+
>
298+
<div className="py-6">
299+
<SearchXIcon className="size-16 text-foreground" />
300+
</div>
301+
<Heading variant="h5" className="font-medium">
302+
No matching entries
303+
</Heading>
304+
<Type small muted className="mb-4 text-center">
305+
No MCP servers match your query. Try adjusting or clearing your
306+
search.
307+
</Type>
308+
<Button onClick={onClear} size="sm">
309+
Clear Search
310+
</Button>
311+
</Stack>
312+
</div>
313+
);
314+
}
315+
292316
interface MCPServerCardProps {
293317
server: Server;
294318
onAddToProject: (server: Server) => void;

0 commit comments

Comments
 (0)