import { useState } from "react"; import styles from "../../styles"; import { colors } from "../../styles"; import TextField from "@mui/material/TextField"; import AddToQueueIcon from "@mui/icons-material/AddToQueue"; import Button from "../../Components/Button/Button"; import { toast } from "react-toastify"; import { AvailableEquipmentInstancesAPI, TransactionCreateAPI, TeachersAPI, UserAPI, } from "../../Components/API/API"; import FormControl from "@mui/material/FormControl"; import FormLabel from "@mui/material/FormLabel"; import { useQueryClient } from "@tanstack/react-query"; import { useQuery } from "@tanstack/react-query"; import { Select, CircularProgress, MenuItem, OutlinedInput, } from "@mui/material"; import React from "react"; import Header from "../../Components/Header/Header"; import { useNavigate } from "react-router-dom"; export default function AddTransactionPage() { const navigate = useNavigate(); const queryClient = useQueryClient(); const [selecteditems, SetSelectedItems] = useState([]); const [selectedteacher, SetSelectedTeacher] = useState(0); const [remarks, SetRemarks] = useState(""); const [error, setError] = useState(""); const equipments = useQuery({ queryKey: ["equipment_instances_available"], queryFn: AvailableEquipmentInstancesAPI, }); const teachers = useQuery({ queryKey: ["teachers"], queryFn: TeachersAPI, }); const user = useQuery({ queryKey: ["user"], queryFn: UserAPI, }); const isLoading = equipments.isLoading || teachers.isLoading || user.isLoading; if (isLoading) { return (

Loading

); } return (

New Transaction

Items Requested Assigned Teacher ) => { SetRemarks(e.target.value); setError(""); }} value={remarks} placeholder={"Optionally add a brief description of the request"} />

{error}

); }