lbry-desktop/ui/component/claimAbandonButton/view.jsx

23 lines
677 B
React
Raw Normal View History

// @flow
import * as MODALS from 'constants/modal_types';
import * as ICONS from 'constants/icons';
import React from 'react';
import Button from 'component/button';
type Props = {
doOpenModal: (string, {}) => void,
claim: StreamClaim,
abandonActionCallback: any => void,
2020-06-21 18:51:06 +02:00
iconSize: number,
};
export default function ClaimAbandonButton(props: Props) {
2020-06-21 18:51:06 +02:00
const { doOpenModal, claim, abandonActionCallback, iconSize } = props;
function abandonClaim() {
doOpenModal(MODALS.CONFIRM_CLAIM_REVOKE, { claim: claim, cb: abandonActionCallback });
}
2020-06-21 18:51:06 +02:00
return <Button disabled={!claim} button="alt" iconSize={iconSize} icon={ICONS.DELETE} onClick={abandonClaim} />;
}