mirror of
https://github.com/felipegcoutinho/openmonetis.git
synced 2026-05-09 02:51:46 +00:00
Arquivos de queries, helpers e controllers dispersos na raiz de dashboard/ foram movidos para subdiretórios temáticos (bills/, invoices/, notes/, notifications/, overview/, payments/, goals-progress/, categories/). ~25 widgets monolíticos obsoletos removidos em favor de nova arquitetura baseada em widget-registry com components/widgets/. Novos componentes: category-breakdown-chart/list, goals-progress-item, percentage-change-indicator. Imports atualizados em fetch-dashboard-data e transaction-filters limpos. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
29 lines
661 B
TypeScript
29 lines
661 B
TypeScript
"use client";
|
|
|
|
import { useState } from "react";
|
|
import {
|
|
DEFAULT_PAYMENT_OVERVIEW_TAB,
|
|
type PaymentOverviewTab,
|
|
parsePaymentOverviewTab,
|
|
} from "@/features/dashboard/payments/payment-overview-tabs";
|
|
|
|
type PaymentOverviewWidgetController = {
|
|
activeTab: PaymentOverviewTab;
|
|
handleTabChange: (value: string) => void;
|
|
};
|
|
|
|
export function usePaymentOverviewWidgetController(): PaymentOverviewWidgetController {
|
|
const [activeTab, setActiveTab] = useState<PaymentOverviewTab>(
|
|
DEFAULT_PAYMENT_OVERVIEW_TAB,
|
|
);
|
|
|
|
const handleTabChange = (value: string) => {
|
|
setActiveTab(parsePaymentOverviewTab(value));
|
|
};
|
|
|
|
return {
|
|
activeTab,
|
|
handleTabChange,
|
|
};
|
|
}
|