File size: 1,435 Bytes
0b9dc2e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import type { LucideIcon } from 'lucide-react';

import {
	Empty,
	EmptyDescription,
	EmptyHeader,
	EmptyMedia,
	EmptyTitle,
} from '@/components/ui/empty';
import { cn } from '@/lib/utils';

interface PanelEmptyProps {
	/** Icon communicating the kind of emptiness (no data vs no results). */
	icon: LucideIcon;
	/** Short heading, e.g. "No MCP servers" or "No results". */
	title: string;
	/** Optional secondary explanation line. */
	description?: string;
	className?: string;
}

/**

 * A reusable empty-state for dock panels. Fills the remaining vertical

 * space and centers an icon + title + optional description. Callers

 * distinguish a "no data yet" state from a "search found nothing"

 * state via the {@link icon} and {@link title} they pass.

 *

 * @param icon - The lucide icon to show.

 * @param title - The empty-state heading.

 * @param description - Optional explanatory text.

 * @param className - Extra classes for the wrapper.

 * @returns The centered empty-state element.

 */
export function PanelEmpty({ icon: Icon, title, description, className }: PanelEmptyProps) {
	return (
		<Empty className={cn('flex-1 border-0 p-4', className)}>

			<EmptyHeader>

				<EmptyMedia variant="icon">

					<Icon />

				</EmptyMedia>

				<EmptyTitle>{title}</EmptyTitle>

				{description ? <EmptyDescription>{description}</EmptyDescription> : null}

			</EmptyHeader>

		</Empty>
	);
}