import Box from '@mui/material/Box'; import Button from '@mui/material/Button'; import type { CardProps } from '@mui/material/Card'; import Card from '@mui/material/Card'; import { useTheme } from '@mui/material/styles'; import Tab from '@mui/material/Tab'; import Tooltip from '@mui/material/Tooltip'; import { useTabs } from 'minimal-shared/hooks'; import { Chart, useChart } from 'src/components/chart'; import { CustomTabs } from 'src/components/custom-tabs'; import { Iconify } from 'src/components/iconify'; import { Label } from 'src/components/label'; import { fCurrency, fPercent } from 'src/utils/format-number'; // ---------------------------------------------------------------------- const TABS = [ { value: 'income', label: 'Income', percent: 8.2, total: 9990, chart: { series: [{ data: [5, 31, 33, 50, 99, 76, 72, 76, 89] }] }, }, { value: 'expenses', label: 'Expenses', percent: -6.6, total: 1989, chart: { series: [{ data: [10, 41, 35, 51, 49, 62, 69, 91, 148] }] }, }, ]; export function BankingOverview({ sx, ...other }: CardProps) { const theme = useTheme(); const tabs = useTabs('income'); const chartColors = tabs.value === 'income' ? [theme.palette.primary.dark] : [theme.palette.warning.dark]; const chartOptions = useChart({ colors: chartColors, xaxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep'] }, stroke: { width: 3 }, tooltip: { y: { formatter: (value: number) => fCurrency(value), title: { formatter: () => '' } }, }, }); const renderBalance = () => ( Total balance {fCurrency(49990)} ); const renderActions = () => ( ); const renderTabs = () => ( {TABS.map((tab) => (
{tab.label} {fCurrency(tab.total)}
} /> ))}
); return ( {renderBalance()} {renderActions()} {renderTabs()} ); }