import componentRender from '../_utils/component-render';
import Confirm from './Confirm';
const render = componentRender(Confirm);
export default {
  success(data) {
    const vm = render(data);
    vm.type = 'success';
    const promise = vm.run();

    promise.update = data => vm.update(data);

    promise.vm = vm;
    return promise;
  },

  error(data) {
    const vm = render(data);
    vm.type = 'error';
    const promise = vm.run();

    promise.update = data => vm.update(data);

    promise.vm = vm;
    return promise;
  }

};