- {title}
-
+
+ {title}
+
{value}
- {subtitle}
+ {subtitle}
)
}
export default function DashboardPage() {
+ const { theme } = useTheme('ui_theme', 'dark')
+ const isLight = theme === 'light'
const [period, setPeriod] = useState('month')
const workOrdersQ = useQuery({
@@ -160,8 +165,8 @@ export default function DashboardPage() {
.sort((a, b) => +new Date(b.updated_at) - +new Date(a.updated_at))
.slice(0, 6)
- const recentDocs = [...invoicesPeriod]
- .sort((a, b) => +new Date(b.issued_at) - +new Date(a.issued_at))
+ const recentExpenses = [...expensesPeriod]
+ .sort((a, b) => +new Date(b.date) - +new Date(a.date))
.slice(0, 6)
return {
@@ -174,7 +179,7 @@ export default function DashboardPage() {
monthDocs,
activeStaff,
recentOrders,
- recentDocs,
+ recentExpenses,
periodOrdersCount: workOrdersPeriod.length,
periodDocsCount: invoicesPeriod.length,
}
@@ -186,14 +191,14 @@ export default function DashboardPage() {
return (