import React from "react" import { MenuItem } from "react-bootstrap" import RefreshIndicator from "./refresh" export class WishlistButton extends React.PureComponent { constructor(props) { super(props); this.handleClick = this.handleClick.bind(this); } handleClick(e) { e.preventDefault(); if (this.props.wishlisted) { this.props.deleteFromWishlist(this.props.resourceId); } else { this.props.addToWishlist(this.props.resourceId); } } render() { if (this.props.wishlisted) { return ( Delete from wishlist ); } else { return ( Add to wishlist ); } } } export class DeleteButton extends React.PureComponent { constructor(props) { super(props); this.handleClick = this.handleClick.bind(this); } handleClick(e) { e.preventDefault(); this.props.deleteFunc(this.props.resourceId, this.props.lastFetchUrl); } render() { return ( Delete ); } } export class RefreshButton extends React.PureComponent { constructor(props) { super(props); this.handleClick = this.handleClick.bind(this); } handleClick(e) { e.preventDefault(); if (this.props.fetching) { return } this.props.getDetails(this.props.resourceId); } render() { return ( ); } }