summaryrefslogtreecommitdiff
path: root/gui/src/components/BudgetUpdatesTable
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2024-10-22 07:46:43 +0100
committerJoe Carstairs <me@joeac.net>2024-10-22 07:46:43 +0100
commit5824c353f978a5b9ab9696451ee3014c6a614ffc (patch)
treebc39754ca417e84eb00b0aa9a1ae2330da0bf282 /gui/src/components/BudgetUpdatesTable
parent7adaace61a4fe983eba5ded3aaaf624ce6fb9014 (diff)
Refactors importer to use core stuff
Diffstat (limited to 'gui/src/components/BudgetUpdatesTable')
-rw-r--r--gui/src/components/BudgetUpdatesTable/BudgetUpdatesTable.css1
-rw-r--r--gui/src/components/BudgetUpdatesTable/BudgetUpdatesTable.tsx36
2 files changed, 37 insertions, 0 deletions
diff --git a/gui/src/components/BudgetUpdatesTable/BudgetUpdatesTable.css b/gui/src/components/BudgetUpdatesTable/BudgetUpdatesTable.css
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/gui/src/components/BudgetUpdatesTable/BudgetUpdatesTable.css
@@ -0,0 +1 @@
+
diff --git a/gui/src/components/BudgetUpdatesTable/BudgetUpdatesTable.tsx b/gui/src/components/BudgetUpdatesTable/BudgetUpdatesTable.tsx
new file mode 100644
index 0000000..479d69f
--- /dev/null
+++ b/gui/src/components/BudgetUpdatesTable/BudgetUpdatesTable.tsx
@@ -0,0 +1,36 @@
+import { BudgetUpdate } from '../../types/budgetUpdate';
+import './BudgetUpdatesTable.css';
+
+function BudgetUpdatesTable({ budgetUpdates }: Props) {
+ return (
+ <table>
+ <thead>
+ <tr>
+ <td>Date</td>
+ <td>Quantity</td>
+ <td>Period</td>
+ </tr>
+ </thead>
+
+ <tbody>
+ { budgetUpdates.map(Row) }
+ </tbody>
+ </table>
+ );
+}
+
+function Row(budgetUpdate: BudgetUpdate) {
+ return (
+ <tr>
+ <td>{budgetUpdate.date.format("DD Mm YYYY")}</td>
+ <td>{budgetUpdate.newQuantity.toString()}</td>
+ <td>{budgetUpdate.newPeriod}</td>
+ </tr>
+ )
+}
+
+type Props = {
+ budgetUpdates: BudgetUpdate[];
+}
+
+export { BudgetUpdatesTable };