diff --git a/frontend/src/components/common/BranchTable.tsx b/frontend/src/components/common/BranchTable.tsx index c8f5717..586808d 100644 --- a/frontend/src/components/common/BranchTable.tsx +++ b/frontend/src/components/common/BranchTable.tsx @@ -69,72 +69,78 @@ const BranchTable: React.FC = () => { }; return ( <> -
-
-

- All Branches -

-
- +
+
+
+

+ All Branches +

- -
- { - - - - } +
+
+ +
+ +
+ { + + + + } +
- - - ID - Location - Actions - - { - !loading && branches.length > 0 ? ( - }> - {branches.map((branch, index) => { - - return ( - - - {branch.branch_id} - - - - {branch.location} - - - - -
- - - - - - - Edit +
+
+ + ID + Location + Actions + + { + !loading && branches.length > 0 ? ( + }> + {branches.map((branch, index) => { + + return ( + + + {branch.branch_id} + + + + {branch.location} + + + + +
+ + + + + + + Edit + + + handleDelete(branch._id)}> + Delete - - handleDelete(branch._id)}> - Delete - - - - -
-
-
- ); - })} -
- ) : - } emptyContent={"No data found."}>{[]} - } -
+ + + +
+ + + ); + })} + + ) : + } emptyContent={"No data found."}>{[]} + } + +
{ !loading && total > 0 &&
diff --git a/frontend/src/components/common/TransactionTable.tsx b/frontend/src/components/common/TransactionTable.tsx index 5a3743e..e7bfa0d 100644 --- a/frontend/src/components/common/TransactionTable.tsx +++ b/frontend/src/components/common/TransactionTable.tsx @@ -28,60 +28,65 @@ function TransactionTable() { <>
-

- All Transactions -

+
+

+ All Transactions +

+
+ +
+
+ + + + Transaction Id + Amount + Status + Date + + { + transactions.length > 0 ? ( + + {transactions.sort((a, b) => { + const dateA = new Date(a.date).getTime(); + const dateB = new Date(b.date).getTime(); + + // Sort in descending order + return dateB - dateA; + + }).map((transaction, index) => { + + return ( + < TableRow key={index} > + + {transaction.transaction_id} + + + + {transaction.amount} + + + + + {transaction.status} + + + + + {new Date(transaction.date).toLocaleDateString()} + + + + + ); + })} + + ) : + {[]} + } +
- - - Transaction Id - Amount - Status - Date - - { - transactions.length > 0 ? ( - - {transactions.sort((a, b) => { - const dateA = new Date(a.date).getTime(); - const dateB = new Date(b.date).getTime(); - - // Sort in descending order - return dateB - dateA; - - }).map((transaction, index) => { - - return ( - < TableRow key={index} > - - {transaction.transaction_id} - - - - {transaction.amount} - - - - - {transaction.status} - - - - - {new Date(transaction.date).toLocaleDateString()} - - - - - - ); - })} - - ) : - {[]} - } -
{/* { total > 0 &&