'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _reactIntl = require('react-intl');

exports.default = function () {
  return {
    messages: (0, _reactIntl.defineMessages)({
      name: {
        'id': 'form.blob.default.name',
        'defaultMessage': 'Standard Template'
      }
    }),
    sortOrder: 0,
    template: function template(data) {
      if (!data) {
        return null;
      }

      var document = data.get('document');

      if (!document) {
        return null;
      }

      // Show the view template if this is an existing record, or the upload template if new.
      return document.getIn(['ns2:collectionspace_core', 'uri']) ? 'view' : 'upload';
    }
  };
};