import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' // import Highcharts from 'highcharts' // import HighchartsReact from 'highcharts-react-official' // import { Button, CardText, Col, Row, Tag, UncontrolledTooltip } from 'reactstrap' // import { Badge } from 'primereact/badge' import { Button as ButtonP } from 'primereact/button' import { format_angka } from '../util' // import collect from 'collect.js' import jquery from 'jquery' import 'primereact/resources/themes/bootstrap4-light-blue/theme.css' import 'primeflex/primeflex.css' // import Avatar from '../../commons/avatar' // import classnames from 'classnames' // import { Sidebar } from 'primereact/sidebar' // import { MantineReactTable, useMantineReactTable } from 'mantine-react-table' // import { Text } from '@mantine/core' // import { QueryClient, QueryClientProvider, useInfiniteQuery } from '@tanstack/react-query' // import dayjs from 'dayjs' import { Skeleton } from '@mui/material' // import { ArchiveRounded, Money, MoneyRounded } from '@mui/icons-material' import 'primeicons/primeicons.css' import { useDispatch, useSelector } from 'react-redux' import { setProgresifitasPembayaran } from '../store/KpdlStore' import Pembayaran from './tabelPerubahanPerilaku/pembayaran' import { Col, Row } from 'reactstrap' import Pendaftaran from './tabelPerubahanPerilaku/Pendaftaran' var relativeTime = require('dayjs/plugin/relativeTime') const fetchSize = 101 const PerubahanPerilaku = ({ dataSend }) => { const base_url = '/engineN/' const [data, setData] = useState(null) const [selectedBulan, setSelectedBulan] = useState('') const [selectedBulanText, setSelectedBulanText] = useState('semua') const [bulan, setBulan] = useState([]) const [query, setQuery] = useState(null) const [loading, setLoading] = useState(false) const [jenisPerubahan, setJenisPerubahan] = useState({ pembayaran: { nilai: 0 } }, { pelaporan: { nilai: 0 } }) const kpdlStore = useSelector((state) => state.kpdl) const dispatch = useDispatch() const [visibleSidebar1, setVisibleSidebar1] = useState(false) const [visibleSidebar2, setVisibleSidebar2] = useState(false) const [visibleSidebar3, setVisibleSidebar3] = useState(false) useEffect(() => { setLoading(true) jquery.get({ url: base_url + 'kewilayahan/kytp/perubahanperilaku', dataType: 'json', type: 'POST', data: { ...dataSend }, success: (data) => { setData(data) dispatch(setProgresifitasPembayaran(data.dataC)) setLoading(false) } }) }, [dataSend]) // useEffect(() => { // const filtered = kpdlStore.progresifitasPembayaran ? kpdlStore.progresifitasPembayaran.filter((val, key) => val.color === 'black') : 0 // // console.log({ filtered }) // }, [kpdlStore]) return ( <> Perubahan Perilaku WP Pasca kegiatan Matoa Pembayaran {loading ? ( ) : ( setVisibleSidebar1(true)} /> )} Rp {format_angka(data?.pembayaranRupiah ?? 0)} {/* since last visit */} SPT Tahunan {loading ? ( ) : ( )} - {/* since last week */} Penambahan NPWP {loading ? ( ) : ( setVisibleSidebar2(true)} /> )} - {/* since last week */} > ) } export default PerubahanPerilaku