'use client' // MUI Imports import Grid from '@mui/material/Grid2' // Component Imports import DistributedBarChartOrder from '@views/dashboards/crm/DistributedBarChartOrder' // Server Action Imports import Loading from '../../../../../../components/layout/shared/Loading' import { usePaymentAnalytics } from '../../../../../../services/queries/analytics' import { PaymentDataItem } from '../../../../../../types/services/analytic' import PaymentMethodReport from '../../../../../../views/dashboards/payment-methods/PaymentMethodReport' import { Typography, TextField, useTheme } from '@mui/material' import { useState } from 'react' import { formatDateDDMMYYYY, formatForInputDate } from '../../../../../../utils/transform' const DashboardPayment = () => { const theme = useTheme() const today = new Date() const monthAgo = new Date() monthAgo.setDate(today.getDate() - 30) const [filter, setFilter] = useState({ date_from: formatDateDDMMYYYY(monthAgo), date_to: formatDateDDMMYYYY(today) }) const { data, isLoading } = usePaymentAnalytics({ date_from: filter.date_from, date_to: filter.date_to }) if (isLoading) return return (
Payments Analysis Dashboard
{ setFilter({ ...filter, date_from: formatDateDDMMYYYY(new Date(e.target.value)) }) }} size='small' sx={{ '& .MuiOutlinedInput-root': { '&.Mui-focused fieldset': { borderColor: 'primary.main' }, '& fieldset': { borderColor: theme.palette.mode === 'dark' ? 'rgba(231, 227, 252, 0.22)' : theme.palette.divider } } }} /> - {}} size='small' sx={{ '& .MuiOutlinedInput-root': { '&.Mui-focused fieldset': { borderColor: 'primary.main' }, '& fieldset': { borderColor: theme.palette.mode === 'dark' ? 'rgba(231, 227, 252, 0.22)' : theme.palette.divider } } }} />
) } export default DashboardPayment