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,EAAAA,KAAA,KAAGc,UAAU,uCAAuCX,MAAO,CAACa,SAAS,QAAQd,UACzEF,EAAAA,EAAAA,KAAA,QAAMc,UAAU,YAAYX,MAAO,CAACa,SAAS,QAAQd,SAAEsC,EAAW2C,EAAM1C,oBAGhFzC,EAAAA,EAAAA,KAAA,MAAIG,MAAO,CAAC6F,MAAM,SAAS9F,SAAEiF,EAAMzC,SACnC1C,EAAAA,EAAAA,KAAA,KAAGc,UAAU,mBAAmBX,MAAO,CAACa,SAAS,QAAQd,SAAEiF,EAAMxC,YAViDyC,MAe9HpF,EAAAA,EAAAA,KAAA,OAAKc,UAAU,oCAAmCZ,UAC9CF,EAAAA,EAAAA,KAAA,UAAQiG,KAAK,SAASnF,UAAU,sDAAsDX,MAAO,CAACoB,MAAM,OAAQ2E,OAAO,OAAQzF,gBAAgB,UAAW0F,aAAa,QAAStG,QAASA,IAAM0D,EAAUD,EAAO,IAAIpD,SAAC,gCAGzNF,EAAAA,EAAAA,KAACoG,EAAAA,EAAY,CAAC1G,QAAS8D,EAAS7D,YAAY,oBAC5CK,EAAAA,EAAAA,KAACqG,EAAgB,CAAC3G,QAASoD,EAAWnD,YAAa,UAASmD,EAAY,oBAAsB,IAAMlD,gBAAiBqD,EAAqBpD,QArDrIyG,KACrBf,SAASC,KAAKrF,MAAMsF,SAAW,OAC/B1C,GAAa,GACbG,EAAuB,KAAK,aAwDpC,C","sources":["component/alert/informationAlert.js","views/informasi/index.js","services/API/mod_informasi.js"],"sourcesContent":["import { Component } from \"react\";\r\nimport detailInformasi from './../../images/detail-informasi.png';\r\n\r\nexport default class extends Component {\r\n render() {\r\n \r\n const {visible, customClass, dataInformation, onClick} = this.props;\r\n if(!dataInformation) {\r\n return null;\r\n }\r\n \r\n function formatDate(val) {\r\n var date = new Date(val)\r\n \r\n var day = date.getDate().toLocaleString('en-US', { minimumIntegerDigits: 2, useGrouping: false })\r\n var month = date.getMonth().toLocaleString('en-US', { minimumIntegerDigits: 2, useGrouping: false })\r\n var year = date.getFullYear().toLocaleString('en-US', { minimumIntegerDigits: 2, useGrouping: false })\r\n var hours = date.getHours().toLocaleString('en-US', { minimumIntegerDigits: 2, useGrouping: false })\r\n var minutes = date.getMinutes().toLocaleString('en-US', { minimumIntegerDigits: 2, useGrouping: false })\r\n var ampm = (date.getHours() >= 12) ? 'PM' : 'AM'\r\n \r\n hours = (hours % 12 === 0) ? 12 : hours % 12\r\n return `${ day }-${ month }-${ year } ${ hours }:${ minutes } ${ ampm }`\r\n }\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \"Image\"\r\n
\r\n

INFO

\r\n

{formatDate(dataInformation.createDate)}

\r\n

{dataInformation.title}

\r\n

{dataInformation.message}

\r\n

{dataInformation.messageInformation}

\r\n
\r\n
\r\n
\r\n
\r\n \r\n )\r\n }\r\n}","import React, {useState, useEffect} from 'react';\r\nimport InformationAlert from \"../../component/alert/informationAlert\";\r\nimport { Link } from 'react-router-dom';\r\nimport { getInformasiByUserid, updateIsRead } from '../../services/API/mod_informasi';\r\nimport LoadingAlert from '../../component/alert/loadingAlert';\r\n\r\nfunction Information(props) {\r\n const [showPopup, setShowPopup] = useState(false)\r\n const [selectedInformation, setSelectedInformation] = useState(null)\r\n const [clickedCard, setClickedCard] = useState([])\r\n const [dataInformation, setDataInformation] = useState([])\r\n const [number, setNumber] = useState(10)\r\n const [loading, setLoading] = useState(false)\r\n const [defaultLoading, setDefaultLoading] = useState(props?.loading ?? true)\r\n\r\n useEffect(() => {\r\n init()\r\n }, [number]);\r\n\r\n\r\n const init = async () => {\r\n setLoading(defaultLoading)\r\n setDefaultLoading(true)\r\n const res = await getInformasiByUserid(number)\r\n setLoading(false)\r\n if(res.status == 200) {\r\n setDataInformation(res?.data?.Table ?? [])\r\n }\r\n }\r\n\r\n const showPopupHandler = (value) => {\r\n document.body.style.overflow = 'hidden';\r\n setShowPopup(true) \r\n setSelectedInformation(value)\r\n }\r\n \r\n const hidePopupHandler = () => {\r\n document.body.style.overflow = 'auto';\r\n setShowPopup(false)\r\n setSelectedInformation(null)\r\n }\r\n const formatDate = (val) => {\r\n var date = new Date(val)\r\n\r\n var day = date.getDate().toLocaleString('en-US', { minimumIntegerDigits: 2, useGrouping: false })\r\n var month = date.getMonth().toLocaleString('en-US', { minimumIntegerDigits: 2, useGrouping: false })\r\n var year = date.getFullYear().toLocaleString('en-US', { minimumIntegerDigits: 2, useGrouping: false })\r\n var hours = date.getHours().toLocaleString('en-US', { minimumIntegerDigits: 2, useGrouping: false })\r\n var minutes = date.getMinutes().toLocaleString('en-US', { minimumIntegerDigits: 2, useGrouping: false })\r\n var ampm = (date.getHours() >= 12) ? 'PM' : 'AM'\r\n \r\n hours = (hours % 12 === 0) ? 12 : hours % 12\r\n return `${ day }-${ month }-${ year } ${ hours }:${ minutes } ${ ampm }`\r\n }\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n Informasi \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n {\r\n dataInformation.map((value, key) => (\r\n
{ showPopupHandler(value); await updateIsRead(value.id.toString()); init()}}>\r\n
\r\n \r\n Info\r\n \r\n \r\n {formatDate(value.createDate)}\r\n \r\n
\r\n
{value.title}
\r\n

{value.message}

\r\n
\r\n ))\r\n }\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n )\r\n}\r\n\r\nexport default Information","import { appConfig } from \"../../config\";\r\nimport { jsonHeaderAuth, refreshAuthLogic } from \"../fetchTools\";\r\nimport axios from 'axios';\r\n\r\nexport const getInformasiByUserid = async (number) => {\r\n\r\n try {\r\n const res = await axios.get(`${appConfig.BASE_API}/notif/readbyRow/${localStorage.getItem('id')}/${number}`, jsonHeaderAuth())\r\n\r\n return {status: res.status, data: res.data}\r\n } catch (error) {\r\n return { status: error.code, message: error.message }\r\n }\r\n}\r\n\r\nexport const updateIsRead = async (id) => {\r\n\r\n try {\r\n const res = await axios.post(`${appConfig.BASE_API}/notif/updateread`, {id : id, isread: true}, jsonHeaderAuth())\r\n\r\n return {status: res.status, data: res.data}\r\n } catch (error) {\r\n return { status: error.code, message: error.message }\r\n }\r\n}"],"names":["Component","render","visible","customClass","dataInformation","onClick","this","props","_jsx","_Fragment","children","style","position","top","left","right","bottom","backgroundColor","zIndex","display","alignItems","justifyContent","className","_jsxs","fontSize","background","border","marginLeft","src","detailInformasi","alt","width","marginBottom","val","date","Date","day","getDate","toLocaleString","minimumIntegerDigits","useGrouping","month","getMonth","year","getFullYear","hours","getHours","getMinutes","formatDate","createDate","title","message","messageInformation","_props$loading","showPopup","setShowPopup","useState","selectedInformation","setSelectedInformation","clickedCard","setClickedCard","setDataInformation","number","setNumber","loading","setLoading","defaultLoading","setDefaultLoading","useEffect","init","async","res","axios","get","appConfig","BASE_API","localStorage","getItem","jsonHeaderAuth","status","data","error","code","getInformasiByUserid","_res$data$Table","_res$data","Table","borderBottom","Link","to","map","value","key","cursor","isRead","document","body","overflow","showPopupHandler","post","id","isread","updateIsRead","toString","color","type","height","borderRadius","LoadingAlert","InformationAlert","hidePopupHandler"],"sourceRoot":""}