Skip to content

Database diagrams editor that allows you to visualize and design your DB with a single query.

fix(empty_state): customize empty state (#533)

Guy Ben-Aharon1643e7bdeb1b
diff --git a/src/components/empty-state/empty-state.tsx b/src/components/empty-state/empty-state.tsx
index 9a32c772..44cd3b8c 100644
--- a/src/components/empty-state/empty-state.tsx
+++ b/src/components/empty-state/empty-state.tsx
@@ -6,25 +6,49 @@ import { cn } from '@/lib/utils';
export interface EmptyStateProps {
title: string;
description: string;
+ imageClassName?: string;
+ titleClassName?: string;
+ descriptionClassName?: string;
}
export const EmptyState = forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement> & EmptyStateProps
->(({ title, description, className }, ref) => (
- <div
- ref={ref}
- className={cn(
- 'flex flex-1 flex-col items-center justify-center space-y-1',
- className
- )}
- >
- <img src={EmptyStateImage} alt="Empty state" className="mb-2 w-20" />
- <Label className="text-base">{title}</Label>
- <Label className="text-sm font-normal text-muted-foreground">
- {description}
- </Label>
- </div>
-));
+>(
+ (
+ {
+ title,
+ description,
+ className,
+ titleClassName,
+ descriptionClassName,
+ imageClassName,
+ },
+ ref
+ ) => (
+ <div
+ ref={ref}
+ className={cn(
+ 'flex flex-1 flex-col items-center justify-center space-y-1',
+ className
+ )}
+ >
+ <img
+ src={EmptyStateImage}
+ alt="Empty state"
+ className={cn('mb-2 w-20', imageClassName)}
+ />
+ <Label className={cn('text-base', titleClassName)}>{title}</Label>
+ <Label
+ className={cn(
+ 'text-sm font-normal text-muted-foreground',
+ descriptionClassName
+ )}
+ >
+ {description}
+ </Label>
+ </div>
+ )
+);
EmptyState.displayName = 'EmptyState';