diff --git a/src/components/AccountSummary.astro b/src/components/AccountSummary.astro index d15f22f..8cd4b6e 100644 --- a/src/components/AccountSummary.astro +++ b/src/components/AccountSummary.astro @@ -1,6 +1,6 @@ --- -import { formatCurrency } from '../utils'; import type { Account } from '../types'; +import { formatCurrency } from '../utils'; interface Props { account: Account; diff --git a/src/components/MainContent.astro b/src/components/MainContent.astro index 99a1570..663ef0f 100644 --- a/src/components/MainContent.astro +++ b/src/components/MainContent.astro @@ -1,6 +1,6 @@ --- -import TransactionTable from './TransactionTable.tsx'; import type { Account } from '../types'; +import TransactionTable from './TransactionTable.tsx'; interface Props { account: Account; diff --git a/src/components/Sidebar.astro b/src/components/Sidebar.astro index 4ec558f..bb84d1c 100644 --- a/src/components/Sidebar.astro +++ b/src/components/Sidebar.astro @@ -1,7 +1,7 @@ --- +import type { Account } from '../types'; import AccountSummary from './AccountSummary.tsx'; // Import the React component instead of the Astro one import AddTransactionForm from './AddTransactionForm.tsx'; -import type { Account } from '../types'; interface Props { accounts: Account[]; diff --git a/src/components/TransactionTable.astro b/src/components/TransactionTable.astro index 7f27a34..6968582 100644 --- a/src/components/TransactionTable.astro +++ b/src/components/TransactionTable.astro @@ -1,6 +1,6 @@ --- -import { formatCurrency, formatDate } from '../utils'; import type { Transaction } from '../types'; +import { formatCurrency, formatDate } from '../utils'; interface Props { transactions: Transaction[]; @@ -10,7 +10,7 @@ const { transactions } = Astro.props; // Sort transactions by date descending for display const sortedTransactions = [...transactions].sort( - (a, b) => new Date(b.date).getTime() - new Date(a.date).getTime() + (a, b) => new Date(b.date).getTime() - new Date(a.date).getTime(), ); // TODO: UI/UX Improvements diff --git a/src/pages/index.astro b/src/pages/index.astro index 9202dd4..625b64d 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,7 +1,7 @@ --- -import BaseLayout from '../layouts/BaseLayout.astro'; -import Sidebar from '../components/Sidebar.astro'; import MainContent from '../components/MainContent.astro'; +import Sidebar from '../components/Sidebar.astro'; +import BaseLayout from '../layouts/BaseLayout.astro'; import type { Account, Transaction } from '../types'; export interface Props { @@ -28,7 +28,7 @@ const initialAccount: Account = accounts[0] || { let initialTransactions: Transaction[] = []; if (initialAccount.id) { const transactionsResponse = await fetch( - `${baseUrl}/api/accounts/${initialAccount.id}/transactions` + `${baseUrl}/api/accounts/${initialAccount.id}/transactions`, ); initialTransactions = await transactionsResponse.json(); }