import { FaRegEdit } from "react-icons/fa";

export default function CoffeeCard({
  title,
  description,
  price,
  image,
  onEdit,
}) {
  return (
    <div
      className="bg-white border border-gray-200 rounded-2xl p-4
                    hover:shadow-lg transition-all duration-300"
    >
      {/* تصویر */}
      <img
        src={image}
        alt={title}
        className="w-full h-40 object-cover rounded-xl mb-3"
      />

      {/* عنوان */}
      <h3 className="font-bold text-text1 text-base mb-2">{title}</h3>

      {/* توضیح */}
      <p className="text-sm text-gray-500 mb-3 line-clamp-2">{description}</p>

      {/* فوتر */}
      <div className="flex justify-between items-center">
        <span className="font-bold text-text1">{price} تومان</span>

        <button
          onClick={onEdit}
          className="flex items-center gap-1 text-sm
                     text-button1 hover:text-[#5f494f] transition-colors"
        >
          <FaRegEdit />
          ویرایش
        </button>
      </div>
    </div>
  );
}
