import { StatCard } from '@/components/cards/stat-card'; import { analysis } from '@/routes'; import type { AnalysisPageProps } from '@/types'; import { Head, usePage } from '@inertiajs/react'; import { CustomBarChart } from '../components/charts/bar-chart'; import { CustomPieChart } from '../components/charts/pie-chart'; import { RevenueVsProfitChart } from '../components/charts/revenue-vs-profit-chart'; import { TransactionVolumeChart } from '../components/charts/transaction-volume-chart'; import { RevenueVsPurchasesChart } from '../components/charts/revenue-vs-purchases-chart'; import { SalesByHourChart } from '../components/charts/sales-by-hour-chart'; export default function Analisa() { const { stats, salesByMonth, revenueVsProfit, transactionVolume, salesByHour, paymentMethods, orderStatuses, orderChannels, topProducts, topCustomers } = usePage().props; return ( <>

Analisa

{/* Stats Grid */}
{[ { title: "Total Penjualan", stat: stats.total_sales, isCurrency: false }, { title: "Total Pendapatan", stat: stats.total_revenue }, { title: "Total Pengeluaran", stat: stats.total_expenses }, { title: "HPP (Modal)", stat: stats.cogs }, { title: "AOV (Avg Order Value)", stat: stats.aov }, { title: "Profit Margin", stat: stats.profit_margin, isPercentage: true }, { title: "Total Diskon", stat: stats.total_discount }, { title: "Laba Kotor", stat: stats.gross_profit }, { title: "Laba Bersih", stat: stats.net_profit }, { title: "Total Gaji", stat: stats.total_payrolls }, { title: "Total Pembelian", stat: stats.total_purchases }, { title: "Produk Terjual", stat: stats.products_sold, isCurrency: false }, { title: "Total Pelanggan", stat: stats.total_customers, isCurrency: false }, ].map((item, index) => (
))}
{/* Main Trends Grid */}
{/* Activity & Volume Grid */}
); } Analisa.layout = { breadcrumbs: [ { title: 'Analisa', href: analysis().url, }, ], };