import React from 'react';
import clsx from 'clsx';
import { FolderOpen } from 'lucide-react';
import { useTranslation } from 'react-i18next';

export interface EmptyStateProps {
  title?: string;
  description?: string;
  icon?: React.ReactNode;
  action?: React.ReactNode;
  className?: string;
  children?: React.ReactNode;
}

export function EmptyState({
  title,
  description,
  icon,
  action,
  className,
}: EmptyStateProps) {
  const { t } = useTranslation();

  return (
    <div
      className={clsx(
        'flex flex-col items-center justify-center py-12 px-6 text-center',
        className
      )}
      role="status"
    >
      {icon && (
        <div className="mb-4 text-secondary-300" aria-hidden="true">
          {icon}
        </div>
      )}
      {!icon && (
        <div className="mb-4 w-16 h-16 rounded-full bg-secondary-100 flex items-center justify-center" aria-hidden="true">
          <FolderOpen className="w-8 h-8 text-secondary-400" />
        </div>
      )}
      <h3 className="text-lg font-semibold text-secondary-900">
        {title || t('emptyState.title')}
      </h3>
      <p className="mt-1 text-sm text-secondary-500 max-w-sm">
        {description || t('emptyState.description')}
      </p>
      {action && <div className="mt-6">{action}</div>}
    </div>
  );
}
