import React from 'react';
import createReactClass from 'create-react-class';
import Icon from "../../../../components/icon"; // `~` is replaced with design-system-react at runtime

import IconSettings from "../../../../components/icon-settings";
import action from '@salesforce-ux/design-system/assets/icons/action-sprite/svg/symbols.svg';
import custom from '@salesforce-ux/design-system/assets/icons/custom-sprite/svg/symbols.svg';
import utility from '@salesforce-ux/design-system/assets/icons/utility-sprite/svg/symbols.svg';
import standard from '@salesforce-ux/design-system/assets/icons/standard-sprite/svg/symbols.svg';
import doctype from '@salesforce-ux/design-system/assets/icons/doctype-sprite/svg/symbols.svg';
var sprites = {
  action: action,
  custom: custom,
  utility: utility,
  standard: standard,
  doctype: doctype
};
var Example = createReactClass({
  displayName: 'IconSettingsExample',
  componentDidMount: function componentDidMount() {
    var _this = this;

    Promise.all(Object.keys(sprites).map(function (category) {
      return fetch(sprites[category]).then(function (resp) {
        return resp.text();
      });
    })).then(function (texts) {
      _this.spriteInlineContainer.innerHTML = texts.join('');
    });
  },
  render: function render() {
    var _this2 = this;

    return React.createElement(IconSettings, {
      onRequestIconPath: function onRequestIconPath(_ref) {
        var category = _ref.category,
            name = _ref.name;
        return "#".concat(name);
      }
    }, React.createElement("div", {
      ref: function ref(el) {
        _this2.spriteInlineContainer = el;
      }
    }), React.createElement("div", {
      className: "slds-grid slds-grid--pull-padded slds-grid--vertical-align-center"
    }, React.createElement("div", {
      className: "slds-col--padded"
    }, React.createElement(Icon, {
      assistiveText: {
        label: 'Account'
      },
      category: "standard",
      name: "account",
      size: "small"
    })), React.createElement("div", {
      className: "slds-col--padded"
    }, React.createElement(Icon, {
      assistiveText: {
        label: 'Announcement'
      },
      category: "utility",
      name: "announcement",
      size: "small"
    })), React.createElement("div", {
      className: "slds-col--padded"
    }, React.createElement(Icon, {
      assistiveText: {
        label: 'Description'
      },
      category: "action",
      name: "description",
      size: "small"
    })), React.createElement("div", {
      className: "slds-col--padded"
    }, React.createElement(Icon, {
      assistiveText: {
        label: 'XML'
      },
      category: "doctype",
      name: "xml",
      size: "small"
    })), React.createElement("div", {
      className: "slds-col--padded"
    }, React.createElement(Icon, {
      assistiveText: {
        label: 'custom5'
      },
      category: "custom",
      name: "custom5",
      size: "small"
    }))));
  }
});
export default Example; // export is replaced with `ReactDOM.render(<Example />, mountNode);` at runtime
//# sourceMappingURL=on-request-icon-path.js.map