fe-pilot
Version:
scanner in web, phonebook in web, autofill otp in web, share web, TextToSpeech in web, Voice Recognition in web, live location tracking in web, detect my location web, wakelock in web, color picker, WhatsappShare, SnapScanner, NetworkMonitor, View360
1 lines • 807 B
JavaScript
import React,{useEffect}from"react";function OfflineUI(a){var b=a.zIndex,c=a.description,d=void 0===c?"No Connection":c;return React.createElement("div",{style:{zIndex:b,background:"#4d4d4d",color:"white",top:"auto",bottom:0,left:"auto",right:"auto",position:"absolute",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",fontSize:"14px"}},d)}function OfflineToast(a){var b=a.children,c=a.isOnline,d=a.setIsToastEnable,e=a.duration,f=void 0===e?0:e,g=a.zIndex,h=void 0===g?9:g;return useEffect(function(){0<f&&!c&&setTimeout(function(){d(!1)},f)},[c]),!c&&React.Children.map(b||React.createElement(OfflineUI,{zIndex:h}),function(a){return React.cloneElement("string"==typeof a?React.createElement(OfflineUI,{zIndex:h,description:a}):a)})}export{OfflineToast};export default OfflineToast;