mirror of
https://github.com/acedanger/finance.git
synced 2025-12-05 22:50:12 -08:00
transitioned from astro to react
This commit is contained in:
34
src/components/MainContent.tsx
Normal file
34
src/components/MainContent.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import { useStore } from '@nanostores/react';
|
||||
import { currentAccount } from '@stores/transactionStore';
|
||||
import TransactionTable from './TransactionTable';
|
||||
|
||||
export default function MainContent() {
|
||||
const account = useStore(currentAccount);
|
||||
|
||||
if (!account) {
|
||||
return (
|
||||
<main className="main-content">
|
||||
<header className="main-header">
|
||||
<h1>No account selected</h1>
|
||||
</header>
|
||||
<div className="no-account">
|
||||
Please select an account from the sidebar to view transactions.
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="main-content">
|
||||
<header className="main-header">
|
||||
<h1>
|
||||
Transactions for{' '}
|
||||
<span id="current-account-name">
|
||||
{account.name} (***{account.accountNumber.slice(-3)})
|
||||
</span>
|
||||
</h1>
|
||||
</header>
|
||||
<TransactionTable />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user