import { useQuery } from "@tanstack/react-query"; import Header from "../../Components/Header/Header"; import styles from "../../styles"; import { EquipmentInstanceLogsAPI } 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 EquipmentInstanceLogsPage() { const equipment_instance_logs = useQuery({ queryKey: ["equipment_instance_logs"], queryFn: EquipmentInstanceLogsAPI, }); if (equipment_instance_logs.isLoading) { return (

Loading

); } return (
Transaction ID Item ID SKU Remarks Status Date Modified {equipment_instance_logs.data ? ( equipment_instance_logs.data.map((equipment_instance_log) => ( {equipment_instance_log.history_id} {equipment_instance_log.id} {`SKU #${equipment_instance_log.equipment} - ${equipment_instance_log.equipment_name}`} {equipment_instance_log.remarks} {equipment_instance_log.status}
{equipment_instance_log.history_date}
{equipment_instance_log.history_user ? "by " + equipment_instance_log.history_user : ""}
)) ) : ( <> )}
); }