@atlaskit/editor-core
Version:
A package contains Atlassian editor core functionality
36 lines • 1.62 kB
JavaScript
import * as tslib_1 from "tslib";
import * as React from 'react';
import { PureComponent } from 'react';
import Spinner from '@atlaskit/spinner';
var ApplicationCard = (function (_super) {
tslib_1.__extends(ApplicationCard, _super);
function ApplicationCard() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.state = {};
_this.onClick = function () {
var _a = _this.props, eventHandlers = _a.eventHandlers, link = _a.link;
if (eventHandlers && eventHandlers.applicationCard && eventHandlers.applicationCard.onClick) {
eventHandlers.applicationCard.onClick(link && link.url ? link.url : undefined);
}
};
return _this;
}
ApplicationCard.prototype.componentDidMount = function () {
var _this = this;
require.ensure([], function () {
var AppCardView = require('@atlaskit/media-card').AppCardView;
_this.setState({ AppCardView: AppCardView });
});
};
ApplicationCard.prototype.render = function () {
var eventHandlers = this.props.eventHandlers;
var AppCardView = this.state.AppCardView;
if (!AppCardView) {
return React.createElement(Spinner, null);
}
return React.createElement(AppCardView, { onClick: this.onClick, model: this.props, onActionClick: eventHandlers && eventHandlers.applicationCard && eventHandlers.applicationCard.onActionClick });
};
return ApplicationCard;
}(PureComponent));
export default ApplicationCard;
//# sourceMappingURL=applicationCard.js.map