@mopinion/survey
Version:
Collect customer feedback with the Mopinion survey library
33 lines (32 loc) • 1.46 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _preact = require("preact");
var _compat = require("preact/compat");
var _form = require("../../form");
var _utils = require("../../../utils");
var _default = exports["default"] = (0, _compat.forwardRef)(function RestartButton(_ref, ref) {
var _text$restartButtonTe, _text$restartButtonTe2;
var _ref$onAnimationEnd = _ref.onAnimationEnd,
onAnimationEnd = _ref$onAnimationEnd === void 0 ? function () {} : _ref$onAnimationEnd;
var _useConfigStore = (0, _form.useConfigStore)(),
_useConfigStore$text = _useConfigStore.text,
text = _useConfigStore$text === void 0 ? {} : _useConfigStore$text;
var reset = (0, _form.useResetForm)();
return (0, _preact.h)("div", {
className: (0, _utils.makeClassName)('restart-button-wrap')
}, (0, _preact.h)("button", {
ref: ref,
type: "button",
className: (0, _utils.makeClassName)('restart-button'),
onAnimationEnd: onAnimationEnd,
onClick: reset,
"aria-label": (_text$restartButtonTe = text.restartButtonText) !== null && _text$restartButtonTe !== void 0 ? _text$restartButtonTe : 'Restart'
}, (0, _preact.h)(_form.SvgIcon, {
icon: "refresh",
alt: "refresh icon"
}), (_text$restartButtonTe2 = text.restartButtonText) !== null && _text$restartButtonTe2 !== void 0 ? _text$restartButtonTe2 : 'Restart'));
});
//# sourceMappingURL=RestartButton.js.map