import { useQuery } from "@tanstack/react-query"; import Header from "../../Components/Header/Header"; import styles from "../../styles"; import { EquipmentLogsAPI } from "../../Components/API/API"; import { CircularProgress } from "@mui/material"; import Table from "@mui/material/Table"; import TableBody from "@mui/material/TableBody"; import TableCell from "@mui/material/TableCell"; import TableContainer from "@mui/material/TableContainer"; import TableHead from "@mui/material/TableHead"; import TableRow from "@mui/material/TableRow"; import Paper from "@mui/material/Paper"; import { colors } from "../../styles"; export default function EquipmentLogsPage() { const equipment_logs = useQuery({ queryKey: ["equipment_logs"], queryFn: EquipmentLogsAPI, }); if (equipment_logs.isLoading) { return (

Loading

); } return (
Transaction ID SKU ID Name Description Category Date Modified {equipment_logs.data ? ( equipment_logs.data.map((equipment_log) => ( {equipment_log.history_id} {equipment_log.id} {equipment_log.name} {equipment_log.description} {equipment_log.category}
{equipment_log.history_date}
{equipment_log.history_user ? "by " + equipment_log.history_user : ""}
)) ) : ( <> )}
); }