mirror of
https://github.com/acedanger/finance.git
synced 2025-12-05 22:50:12 -08:00
feat: Refactor transaction management with nanostores and convert components to React
- Added @nanostores/react for state management. - Created AccountSummary component to display account balance. - Replaced AddTransactionForm.astro with AddTransactionForm.tsx for better state handling. - Introduced TransactionTable.tsx for displaying transactions with edit/delete functionality. - Updated Sidebar.astro and MainContent.astro to use React components. - Implemented transactionStore.ts for managing current account ID and transaction editing state. - Removed obsolete AddTransactionForm.astro and related scripts. - Enhanced error handling and loading states in transaction forms. This fixes issues #7, #8, #9, #10, #11
This commit is contained in:
@@ -1,18 +1,16 @@
|
||||
---
|
||||
import TransactionTable from './TransactionTable.astro';
|
||||
import type { Account, Transaction } from '../types';
|
||||
import TransactionTable from './TransactionTable.tsx';
|
||||
import type { Account } from '../types';
|
||||
|
||||
interface Props {
|
||||
account: Account;
|
||||
transactions: Transaction[];
|
||||
}
|
||||
|
||||
const { account, transactions } = Astro.props;
|
||||
const { account } = Astro.props;
|
||||
---
|
||||
<main class="main-content">
|
||||
<header class="main-header">
|
||||
<h1>Transactions for <span id="current-account-name">{account.name} (***{account.last4})</span></h1>
|
||||
</header>
|
||||
/* Make table updatable */
|
||||
<TransactionTable transactions={transactions} client:load /> {}
|
||||
<TransactionTable client:load />
|
||||
</main>
|
||||
Reference in New Issue
Block a user