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AAK,SAASN,UAAU,YAAY,kBAAgB,QAAQ,aAAW,QAAQO,QAAShB,SAGhG,C","sources":["components/common/alert/alert.tsx"],"sourcesContent":["import { useEffect, useRef } from \"react\";\r\nimport { useSelector } from 'react-redux';\r\nimport { useDispatch } from 'react-redux'\r\nimport { updateAlertMessage } from \"../../../api-integration/commonSlice\";\r\n\r\n\r\nconst Alert = () => {\r\n const dispatch = useDispatch();\r\n const timeoutIdRef = useRef(null);\r\n\r\n const alertMessage = useSelector((state: any) => state.commonSlice.alertMessage);\r\n const { user } = useSelector((state: any) => state.commonSlice);\r\n const timeoutValue = alertMessage.timeout || user?.usrMessageAlertDuration || Number(process.env.REACT_APP_ALERT_TIMEOUT);\r\n\r\n //const timeoutValue = alertMessage.timeout || Number(process.env.REACT_APP_ALERT_TIMEOUT);\r\n\r\n const closeAlert = () => {\r\n dispatch(updateAlertMessage({ status: '', message: '' }));\r\n }\r\n\r\n useEffect(() => {\r\n if (timeoutIdRef.current) {\r\n clearTimeout(timeoutIdRef.current);\r\n }\r\n timeoutIdRef.current = setTimeout(closeAlert, timeoutValue);\r\n return () => {\r\n if (timeoutIdRef.current) {\r\n clearTimeout(timeoutIdRef.current);\r\n }\r\n };\r\n }, [alertMessage, timeoutValue]);\r\n\r\n return (\r\n
\r\n {\r\n alertMessage.status === 'success' &&\r\n
\r\n \r\n \r\n
\r\n }\r\n {\r\n alertMessage.status === 'error' &&\r\n
\r\n {/*pleaseReload.message */}\r\n \r\n \r\n
\r\n }\r\n
\r\n )\r\n}\r\n\r\nexport default Alert;"],"names":["Alert","dispatch","useDispatch","timeoutIdRef","useRef","alertMessage","useSelector","state","commonSlice","user","timeoutValue","timeout","usrMessageAlertDuration","Number","process","closeAlert","updateAlertMessage","status","message","useEffect","current","clearTimeout","setTimeout","_jsxs","className","children","role","_jsx","dangerouslySetInnerHTML","__html","type","onClick"],"sourceRoot":""}