diff --git a/src/Components/DashboardPage/Student/StudentTransactionListView.tsx b/src/Components/DashboardPage/Student/StudentTransactionListView.tsx index ddc7d62..3abe5eb 100644 --- a/src/Components/DashboardPage/Student/StudentTransactionListView.tsx +++ b/src/Components/DashboardPage/Student/StudentTransactionListView.tsx @@ -4,7 +4,7 @@ import styles from "../../../styles"; import CircularProgress from "@mui/material/CircularProgress/CircularProgress"; import React, { useState } from "react"; import TransactionEntry from "../../TransactionEntry/TransactionEntry"; -import StudentTransactionFilterMenu from "./StudentTransactionFilterMenu"; +import TransactionFilterMenu from "../TransactionFilterMenu"; export default function StudentTransactionListView() { const transactions = useQuery({ @@ -39,7 +39,7 @@ export default function StudentTransactionListView() { return (
- +
+ +

+ Loading +

+
+ ); + } + return ( +
+
+ +
+
+ {transactions.data ? ( + transactions.data + .filter((transaction) => + filter !== "" ? transaction.transaction_status == filter : true + ) + .map((transaction) => ( + + + + )) + ) : ( + <> + )} +
+
+
+ ); +} diff --git a/src/Components/DashboardPage/Student/StudentTransactionFilterMenu.tsx b/src/Components/DashboardPage/TransactionFilterMenu.tsx similarity index 98% rename from src/Components/DashboardPage/Student/StudentTransactionFilterMenu.tsx rename to src/Components/DashboardPage/TransactionFilterMenu.tsx index be58c39..d791f16 100644 --- a/src/Components/DashboardPage/Student/StudentTransactionFilterMenu.tsx +++ b/src/Components/DashboardPage/TransactionFilterMenu.tsx @@ -1,4 +1,4 @@ -import styles from "../../../styles"; +import styles from "../../styles"; import { Button, FormControl, @@ -22,7 +22,7 @@ type props = { setFilter: React.Dispatch>; }; -export default function StudentTransactionFilterMenu(props: props) { +export default function TransactionFilterMenu(props: props) { return ( <>

- Personal Transactions + Transactions

@@ -32,7 +33,7 @@ export default function Dashboard() {
-

Welcome teacher!

+
);