// @flow import * as ICONS from 'constants/icons'; import React from 'react'; import Button from 'component/button'; type Props = { collectionId: string, isEdit: boolean, doToast: ({ message: string }) => void, collectionPublishUpdate: (any) => Promise, isUpdatingCollection: boolean, }; function CollectionQuickUpdateButton(props: Props) { const { collectionId, isEdit, doToast, collectionPublishUpdate, isUpdatingCollection } = props; const options = { claim_id: collectionId }; function handleQuickUpdate(e) { e.preventDefault(); collectionPublishUpdate(options) .then(() => { doToast({ message: __('Playlist updated'), }); }) .catch(() => { doToast({ message: __('Something went wrong with your update'), }); }); } if (!isEdit) { return null; } return (
); } export default CollectionQuickUpdateButton;