import { faPen, faTrash } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";

interface AdminEditDeleteButtonsProps {
  onEdit?: () => void;
  onDelete?: () => void;
  size?: "sm" | "md";
  className?: string;
}

export default function AdminEditDeleteButtons({
  onEdit,
  onDelete,
  size = "md",
  className = "",
}: AdminEditDeleteButtonsProps) {
  const sizeClasses = {
    sm: "h-7 w-7",
    md: "h-8 w-8",
  }[size];

  const iconClass = size === "sm" ? "h-3 w-3" : "h-3.5 w-3.5";

  return (
    <div className={`flex items-center gap-1 ${className}`}>
      {onEdit && (
        <button
          type="button"
          onClick={onEdit}
          className={`${sizeClasses} inline-flex items-center justify-center rounded-md text-slate-400 transition-colors hover:bg-slate-800 hover:text-indigo-300 focus:outline-none focus:ring-2 focus:ring-indigo-500/60`}
          title="Edit"
          aria-label="Edit"
        >
          <FontAwesomeIcon icon={faPen} className={iconClass} />
        </button>
      )}
      {onDelete && (
        <button
          type="button"
          onClick={onDelete}
          className={`${sizeClasses} inline-flex items-center justify-center rounded-md text-slate-400 transition-colors hover:bg-rose-500/10 hover:text-rose-400 focus:outline-none focus:ring-2 focus:ring-rose-500/60`}
          title="Delete"
          aria-label="Delete"
        >
          <FontAwesomeIcon icon={faTrash} className={iconClass} />
        </button>
      )}
    </div>
  );
}
