"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");require("../../node_modules/react-redux/es/index.js");var t=require("../../node_modules/@fortawesome/react-fontawesome/index.es.js"),r=require("../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs.js"),l=require("../Button.js"),i=require("../../node_modules/i18next/dist/esm/i18next.js"),a=require("../../utils/genericFunctions/eventDispatch.js");require("../../node_modules/tslib/tslib.es6.js"),require("../../store/index.js");var o=require("../CustomThemedTooltip.js"),n=require("../../node_modules/react-redux/es/hooks/useSelector.js"),s=require("../../node_modules/react-redux/es/hooks/useDispatch.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=d(e);exports.default=function(e){var d=e.uaType,u=n.useSelector((function(e){return e.alerts})).data,p=n.useSelector((function(e){return e.currentUser})).default_device,m=s.useDispatch(),f=Object.values(u).filter((function(e){return e.active})),v=f.length>0?f[f.length-1]:null;return v&&c.default.createElement("div",{className:"pi-relative pi-rounded-md pi-w-full pi-flex"},c.default.createElement("div",{className:"pi-flex pi-items-center"},c.default.createElement("div",{className:"pi-flex pi-items-center pi-justify-center pi-flex-shrink-0 pi-mr-4 pi-rounded-full pi-h-10 pi-w-10 ".concat("call_transfered"===(null==v?void 0:v.type)?"pi-bg-green-200 dark:pi-bg-green-900":"pi-bg-rose-200 dark:pi-bg-rose-900")},c.default.createElement(t.FontAwesomeIcon,{icon:"call_transfered"===(null==v?void 0:v.type)?r.faCircleCheck:r.faCircleXmark,className:"pi-h-5 pi-w-10 ".concat("call_transfered"===(null==v?void 0:v.type)?"pi-text-green-700 dark:pi-text-green-200":"pi-text-rose-700 dark:pi-text-rose-200"),"aria-hidden":"true"})),c.default.createElement("div",{className:"ml-3"},c.default.createElement("h3",{className:"pi-text-lg pi-font-medium pi-text-gray-900 dark:pi-text-gray-50 pi-dark:text-rose-100 margin-block-property"},i.t("Errors.".concat(null==v?void 0:v.type))),c.default.createElement("div",{className:"pi-text-sm pi-font-normal pi-text-gray-700 dark:pi-text-gray-200 pi-dark:text-rose-200 pi-leading-5"},i.t("Errors.".concat(null==v?void 0:v.message))))),c.default.createElement(l.Button,{variant:"transparent",onClick:function(){"nethlink"===(null==p?void 0:p.type)&&"mobile"===d&&"call_transfered"!==(null==v?void 0:v.type)?window.location.reload():"webrtc"===(null==p?void 0:p.type)&&"call_transfered"!==(null==v?void 0:v.type)?a.eventDispatch("phone-island-reload-component",{force:!0}):(m.alerts.removeAllAlerts(),a.eventDispatch("phone-island-all-alerts-removed",{}))},className:"pi-absolute pi--right-6 pi-transform pi--translate-y-1/2","data-tooltip-id":"tooltip-close-alert","data-tooltip-content":"nethlink"===(null==p?void 0:p.type)&&"mobile"===d&&"call_transfered"!==(null==v?void 0:v.type)||"webrtc"===(null==p?void 0:p.type)&&"call_transfered"!==(null==v?void 0:v.type)?"".concat(i.t("Tooltip.Reload")):"".concat(i.t("Tooltip.Close alert"))},c.default.createElement(t.FontAwesomeIcon,{icon:"nethlink"===(null==p?void 0:p.type)&&"call_transfered"!==(null==v?void 0:v.type)||"webrtc"===(null==p?void 0:p.type)&&"call_transfered"!==(null==v?void 0:v.type)?r.faArrowRotateRight:r.faTimes,className:"pi-text-gray-700 dark:pi-text-gray-50 pi-w-4 pi-h-4"})),c.default.createElement(o.CustomThemedTooltip,{id:"tooltip-close-alert",place:"left"}))};
//# sourceMappingURL=index.js.map
