import React from 'react'; import { clsx } from 'clsx'; import { Inbox, Search, FileX, AlertCircle } from 'lucide-react'; import Button from './Button'; export type EmptyStateType = 'default' | 'search' | 'error' | 'no-data'; export interface EmptyStateProps { type?: EmptyStateType; title?: string; description?: string; icon?: React.ReactNode; action?: { label: string; onClick: () => void; }; className?: string; } const defaultIcons = { default: Inbox, search: Search, error: AlertCircle, 'no-data': FileX, }; const defaultTitles = { default: 'No items found', search: 'No results', error: 'Something went wrong', 'no-data': 'No data available', }; const defaultDescriptions = { default: 'Get started by creating a new item.', search: 'Try adjusting your search or filters.', error: 'Please try again later.', 'no-data': 'There is no data to display.', }; /** * Empty state component for displaying when there's no content */ export const EmptyState = ({ type = 'default', title, description, icon, action, className, }: EmptyStateProps) => { const DefaultIcon = defaultIcons[type]; const displayIcon = icon || ; const displayTitle = title || defaultTitles[type]; const displayDescription = description || defaultDescriptions[type]; return (
{displayIcon}

{displayTitle}

{displayDescription && (

{displayDescription}

)} {action && ( )}
); };