import React from "react"
import PropTypes from "prop-types"
import Dropdown from "react-bootstrap/Dropdown"
import RefreshIndicator from "./refresh"
export const WishlistButton = (props) => {
const handleClick = (e) => {
e.preventDefault();
if (props.wishlisted) {
props.deleteFromWishlist(props.resourceId);
} else {
props.addToWishlist(props.resourceId);
}
}
if (props.wishlisted) {
return (
Delete from wishlist
);
} else {
return (
Add to wishlist
);
}
}
export const DeleteButton = (props) => {
const handleClick = () => {
props.deleteFunc(props.resourceId, props.lastFetchUrl);
}
return (
Delete
);
}
DeleteButton.propTypes = {
resourceId: PropTypes.string.isRequired,
lastFetchUrl: PropTypes.string,
deleteFunc: PropTypes.func.isRequired,
};
export const RefreshButton = (props) => {
const handleClick = () => {
if (props.fetching) { return; }
props.getDetails(props.resourceId);
}
return (
);
}
RefreshButton.propTypes = {
fetching: PropTypes.bool.isRequired,
resourceId: PropTypes.string.isRequired,
getDetails: PropTypes.func.isRequired,
};