'use strict'; import React from 'react'; import Form from './form'; import AclInformation from '../ascribe_buttons/acl_information'; import AscribeSpinner from '../ascribe_spinner'; import { getLangText } from '../../utils/lang'; import { formatText } from '../../utils/text'; import { resolveUrl } from '../../utils/url_resolver'; let EditionDeleteForm = React.createClass({ propTypes: { editions: React.PropTypes.arrayOf(React.PropTypes.object), // Propagated by ModalWrapper in most cases handleSuccess: React.PropTypes.func }, getBitcoinIds() { return this.props.editions.map((edition) => edition.bitcoin_id); }, getUrl() { return formatText(resolveUrl('edition_delete'), { // Since this form can be used for either deleting a single edition or multiple we need // to call getBitcoinIds to get the value of edition_id editionId: this.getBitcoinIds().join(',') }); }, render() { return (

} spinner={

}>

{getLangText('Are you sure you would like to permanently delete this edition')}?

{getLangText('This is an irrevocable action%s', '.')}

); } }); export default EditionDeleteForm;