2020-04-24 15:51:00 +02:00
|
|
|
// @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-19 18:26:52 +02:00
|
|
|
iconSize: number,
|
2020-04-24 15:51:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default function ClaimAbandonButton(props: Props) {
|
2020-06-19 18:26:52 +02:00
|
|
|
const { doOpenModal, claim, abandonActionCallback, iconSize } = props;
|
2020-04-24 15:51:00 +02:00
|
|
|
|
|
|
|
function abandonClaim() {
|
|
|
|
doOpenModal(MODALS.CONFIRM_CLAIM_REVOKE, { claim: claim, cb: abandonActionCallback });
|
|
|
|
}
|
|
|
|
|
2020-06-19 18:26:52 +02:00
|
|
|
return <Button disabled={!claim} button="alt" iconSize={iconSize} icon={ICONS.DELETE} onClick={abandonClaim} />;
|
2020-04-24 15:51:00 +02:00
|
|
|
}
|