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

export default function ResetButton({ selectedCategory, setSelectedCategory }) {
  const isActive = selectedCategory !== null;

  return (
    <button
      onClick={() => setSelectedCategory(null)}
      disabled={!isActive}
      className={`px-4 py-2 rounded-lg transition ${
        isActive ? "bg-red-500 hover:bg-red-400" : "bg-gray-700 text-gray-400 cursor-not-allowed"
      }`}
    >
      <FontAwesomeIcon icon={faTimes} /> Reset
    </button>
  );
}
