Frontend
Frontend
App.js
Index.js
import "bootstrap/dist/css/bootstrap.min.css";
 import       "./index.css";
 import       App from "./App";
 import       { Provider } from "react-redux";
 import       React from "react";
 import       ReactDOM from "react-dom";
 import       { createStore } from "redux";
 import       rootReducer from "./redux/globalRedux";
 // ! Store
 const storeRedux = createStore(rootReducer);
 ReactDOM.render(
    <Provider store={storeRedux}>
      <App />
    </Provider>,
    document.getElementById("root")
 );
Router/privateRoute.js
Router/publicRoute.js
Component/Sidebar.js
  handleLogout = () => {
     localStorage.removeItem("token");
     localStorage.removeItem("role");
     localStorage.removeItem("userLogin");
     return this.props.history.push("/");
  };
  render() {
    const drawerWidth = 98;
    const currentPath = this.props.history.location.pathname;
    return (
      <Drawer
        variant="permanent"
        sx={{
           width: drawerWidth,
           flexShrink: 0,
           [`& .MuiDrawer-paper`]: {
              width: drawerWidth,
              boxSizing: "border-box",
              backgroundColor: "#ffff",
              borderRight: "1px solid #EBEBEB",
              // justifyContent: 'center',
           },
        }}
      >
        <Box sx={{ overflow: "auto", mt: 10 }}>
           <List>
              {currentPath === "/dashboard" ? (
                <LayoutIconActive
                  onClick={() => this.handleSideBar("/dashboard")}
                >
                 <EvaIcon name="grid" size="large" fill="#18125C" />
               </LayoutIconActive>
            ) : (
               <LayoutIcon onClick={() => this.handleSideBar("/dashboard")}>
                 <EvaIcon name="grid" size="large" fill="#A5A5A5" />
               </LayoutIcon>
            )}
Container/template/Dashboard.js
     handleLogout = () => {
       localStorage.removeItem("userLogin");
       localStorage.removeItem("token");
       localStorage.removeItem("role");
         return this.props.history.push("/");
     };
     getRole = () => {
        const role = localStorage.getItem("role");
        this.setState({
          role: role,
        });
     };
     componentDidMount() {
       this.getRole();
  }
  render() {
    return (
      <>
         {/* if else admin / masyarakat */}
         {this.state.role === "admin" || this.state.role === "petugas" ? (
           <Box sx={{ display: "flex", backgroundColor: "#232323" }}>
             <CssBaseline />
             <AppBar
               position="fixed"
               sx={{
                  width: `calc(100% - 98px)`,
                  padding: "12px 0px",
                  ml: `98px`,
                  boxShadow: "none",
                  backgroundColor: "transparent",
                  borderBottom: "1px solid #EBEBEB",
               }}
             >
               <Toolbar>
                  <Typography sx={{ pl: 4 }} variant="h6" noWrap
color="#3D3D3D">
                    {this.props.title}
                  </Typography>
               </Toolbar>
             </AppBar>
// ! Panggil globalState
const mapStateToProps = (state, props) => {
   return {
      statusUser: state.statusUser,
   };
};
Component/form/Register.js
 import {
   Checkbox,
   FormControlLabel,
   Button,
   Typography,
   CircularProgress,
   Snackbar,
   Alert,
 } from "@mui/material";
return (
  <>
     <form onSubmit={formik.handleSubmit}>
       <Snackbar
         open={snack}
         autoHideDuration={5000}
         onClose={() => setSnack(false)}
         anchorOrigin={{ vertical: "top", horizontal: "center" }}
       >
         <Alert
           severity="success"
           onClose={() => setSnack(false)}
              sx={{ width: "100%" }}
              style={{ minWidth: 500 }}
          >
            <b>Success. </b> Your account successfully register
          </Alert>
        </Snackbar>
        <DivStyle>
          <TypoStyle sx={{ fontWeight: 600, fontSize: 14, ml: 1, mr: 1 }}>
             Nama
          </TypoStyle>
          <InputStyle
             id="nama"
             name="nama"
             autoComplete="current-nama"
             placeholder="supriyadiiii"
             value={formik.values.nama || ""}
             onChange={formik.handleChange}
          />
          {formik.touched.nama && Boolean(formik.errors.nama) ? (
             <TypoError>{formik.touched.nama &&
formik.errors.nama}</TypoError>
          ) : null}
        </DivStyle>
        <DivStyle>
          <TypoStyle sx={{ fontWeight: 600, fontSize: 14, ml: 1, mr: 1 }}>
             Telepon
          </TypoStyle>
          <InputStyle
             id="telp"
             name="telp"
             autoComplete="current-telp"
             placeholder="081364018392"
             value={formik.values.telp || ""}
             onChange={formik.handleChange}
          />
          {formik.touched.telp && Boolean(formik.errors.telp) ? (
             <TypoError>{formik.touched.telp &&
formik.errors.telp}</TypoError>
          ) : null}
        </DivStyle>
        <DivStyle>
          <TypoStyle sx={{ fontWeight: 600, fontSize: 14, ml: 1, mr: 1 }}>
            Username
          </TypoStyle>
          <InputStyle
            id="username"
            name="username"
            autoComplete="current-username"
            placeholder="username"
            value={formik.values.username || ""}
     onChange={formik.handleChange}
  />
  {(formik.touched.username && Boolean(formik.errors.username)) ||
  alert.show ? (
     <TypoError>
       {(formik.touched.username && formik.errors.username) ||
         alert.message}
     </TypoError>
  ) : null}
</DivStyle>
<DivStyle>
  <TypoStyle sx={{ fontWeight: 600, fontSize: 14, ml: 1, mr: 1 }}>
     Password
  </TypoStyle>
  <InputStyle
     id="password"
     name="password"
     autoComplete="current-password"
     placeholder="password"
     type={showPassword ? "password" : "text"}
     value={formik.values.password || ""}
     onChange={formik.handleChange}
  />
  {formik.touched.password && Boolean(formik.errors.password) ? (
     <TypoError>
       {formik.touched.password && formik.errors.password}
     </TypoError>
  ) : null}
</DivStyle>
Component/form/login.js
 import {
   Checkbox,
   FormControlLabel,
   Button,
   Typography,
   CircularProgress,
 } from "@mui/material";
      setLoginProcess(false);
      return history.push("/dashboard");
    }
  } catch (error) {
    setLoginProcess(false);
    console.log(error);
  }
};
<DivStyle>
  <Typography sx={{ fontWeight: 600, fontSize: 14, ml: 1, mr: 1 }}>
     Password
  </Typography>
  <InputStyle
     id="password"
     name="password"
     autoComplete="current-password"
     placeholder="password"
     type={showPassword ? "password" : "text"}
     value={formik.values.password || ""}
     onChange={formik.handleChange}
  />
  {formik.touched.password && Boolean(formik.errors.password) ? (
     <TypoError>
       {formik.touched.password && formik.errors.password}
     </TypoError>
  ) : null}
</DivStyle>
Component/mainContentRegister.js
        {/*Form Register*/}
        <FormRegister />
        <div className="textMovePageLogin">
          <Typography>Already have an account?</Typography>
          <Typography
            onClick={() => handleRegister()}
            sx={{
               fontWeight: 600,
               ml: 1,
               color: "#FE2E12",
               cursor: "pointer",
            }}
          >
            Sign in
          </Typography>
        </div>
      </Stack>
   );
 };
Component/MainContentLogin.js
<FormLogin />
       <div className="textMovePageLogin">
         <Typography>Don’t have an account?</Typography>
         <Typography
           onClick={() => handleRegister()}
           sx={{
              fontWeight: 600,
              ml: 1,
              color: "#FE2E12",
              cursor: "pointer",
           }}
         >
           Create Account
         </Typography>
       </div>
     </Stack>
   );
};
Component/MainContentDashboard.js
//component nested
import CardCountData from "./dashboard/CardCountData";
import CardUser from "./dashboard/CardUser";
import History from "./dashboard/History";
Component/maintContentLelang.js
//component nested
return (
  <main
    style={{
       flexGrow: 1,
       minHeight: "100vh",
       overflow: "auto",
       background: "#FAFAFA",
    }}
  >
    <Container sx={{ pt: 10 }}>
       <Grid container sx={{ pt: 5, mt: 5 }}>
         <AddLelang
            open={openDialog}
            closeDialog={() => handleCloseDialog()}
            processAdd={() => handleReload()}
         />
         <div
            style={{
               minWidth: "100%",
            }}
         >
            <CardStyle
               style={{
                  maxWidth: "100%",
                  height: 80,
                  display: "flex",
                  justifyContent: "space-between",
               }}
            >
               <div>
                  <FormSearch
                     onKeywordSearchChange={(value) => handleSearch(value)}
                  />
               </div>
               <div>
                   <Button
                     sx={{
                       width: 150,
                       backgroundColor: "#FE2E12",
                       height: "100%",
                       textTransform: "capitalize",
                       borderRadius: 2,
                       color: "#ffff",
                         "&:hover": {
                            backgroundColor: "#FE2E12",
                            color: "#ffff",
                         },
                       }}
                       startIcon={<AddRoundedIcon />}
                       onClick={() => handleOpenDialog()}
                   >
                     Tambah Lelang
                   </Button>
                 </div>
               </CardStyle>
Component/MainContentBarang.js
  useEffect(() => {
    getAllData();
}, []);
return (
  <main
    style={{
       flexGrow: 1,
       minHeight: "100vh",
       overflow: "auto",
       background: "#FAFAFA",
    }}
  >
    <Container sx={{ pt: 10 }}>
       <Grid container sx={{ pt: 5, mt: 5 }}>
         <AddBarang
            open={openDialog}
            closeDialog={() => handleCloseDialog()}
            processAdd={() => handleReload()}
         />
         <div
            style={{
               minWidth: "100%",
            }}
         >
            <CardStyle
               style={{
                  maxWidth: "100%",
                  height: 80,
                  display: "flex",
                  justifyContent: "space-between",
               }}
            >
               <div>
                  <FormSearch
                     onKeywordSearchChange={(value) => handleSearch(value)}
                  />
               </div>
            {/* <div>
              <Button onClick={() => generatePDF(dataBarang)}>
                Generate Laportan
              </Button>
            </div> */}
            <div>
              <Button
                sx={{
                  width: 150,
                  backgroundColor: "#FE2E12",
                  height: "100%",
                  textTransform: "capitalize",
                  borderRadius: 2,
                  color: "#ffff",
                   "&:hover": {
                     backgroundColor: "#FE2E12",
                           color: "#ffff",
                         },
                       }}
                       startIcon={<AddRoundedIcon />}
                       onClick={() => handleOpenDialog()}
                   >
                     Tambah Barang
                   </Button>
                 </div>
               </CardStyle>
Component/dashboard/CardCountData.js
 const cardRedVariant = {
   hidden: {
      x: "-100vw",
      opacity: 0,
   },
   visible: {
      x: 0,
      opacity: 1,
      transition: {
        type: "spring",
        stiffness: 50,
     },
  },
};
const cardWhiteVariant = {
   hidden: {
      opacity: 0,
   },
   visible: {
      opacity: 1,
      transition: {
         delay: 0.9,
         type: "spring",
         stiffness: 50,
      },
   },
};
<motion.div
  variants={cardWhiteVariant}
  initial="hidden"
  animate="visible"
>
  <CardStyle
    style={{
       width: 152,
       backgroundColor: "#ffff",
       boxShadow: "0px 10px 20px #5E5E5E0A",
    }}
  >
    <EvaIcon name="swap" size="xlarge" fill="#18125C" />
    <Typography
       color="#18125C"
       sx={{ marginTop: 1, fontWeight: 500, opacity: 0.5 }}
    >
       Jumlah Transaksi
    </Typography>
    <div
       style={{
          display: "flex",
          width: "100%",
          justifyContent: "space-between",
          alignItems: "flex-end",
       }}
    >
       <Typography
          color="#18125C"
          sx={{ marginTop: 3, fontWeight: 500 }}
          variant="h4"
       >
          981
       </Typography>
       <EvaIcon name="arrow-forward" size="medium" fill="#18125C" />
    </div>
  </CardStyle>
</motion.div>
<motion.div
  variants={cardWhiteVariant}
  initial="hidden"
  animate="visible"
        >
           <CardStyle
              style={{
                 width: 152,
                 backgroundColor: "#ffff",
                 boxShadow: "0px 10px 20px #5E5E5E0A",
              }}
           >
              <EvaIcon name="shopping-bag-outline" size="xlarge"
 fill="#18125C" />
              <Typography
                 color="#18125C"
                 sx={{ marginTop: 1, fontWeight: 500, opacity: 0.5 }}
              >
                 Jumlah Barang
              </Typography>
              <div
                 style={{
                    display: "flex",
                    width: "100%",
                    justifyContent: "space-between",
                    alignItems: "flex-end",
                 }}
              >
                 <Typography
                    color="#18125C"
                    sx={{ marginTop: 3, fontWeight: 500 }}
                    variant="h4"
                 >
                    67
                 </Typography>
                 <EvaIcon name="arrow-forward" size="medium" fill="#18125C" />
              </div>
           </CardStyle>
         </motion.div>
       </div>
    );
 };
Component/dashboard/history.js
    <div className="historyCard">
      <div>
        <img
           src={img1}
           width={40}
           style={{ borderRadius: "50%" }}
           alt=""
        />
      </div>
      <div className="historyCol" id="name">
        Juned Supri
      </div>
      <div className="historyCol" id="date">
        16 Januari 2021
      </div>
      <div className="historyCol" id="price">
        IDR 500.000
      </div>
      <div className="historyCol" id="completed">
        Completed
      </div>
            </div>
          </div>
        </div>
      </>
   );
 };
Component/dashboard/CardUser.js
 const infoVariant = {
    hidden: {
       opacity: 0,
    },
    visible: {
       opacity: 1,
       transition: {
          delay: 0.9,
          type: "spring",
       },
    },
 };
Dialog/AddLelang.js
      console.log(response);
      if (response.data.code === 200 || response.data.code === 201) {
        props.processAdd();
        props.closeDialog();
      }
    } catch (error) {
      console.log(error);
    }
    resetForm();
  };
  useEffect(() => {
    getListBarang();
  }, []);
  return (
    <>
      <div>
        <Dialog open={props.open} onClose={props.closeDialog} maxWidth="xs">
          <form onSubmit={formik.handleSubmit}>
            <DialogTitle>Tambah Barang Lelang</DialogTitle>
            <DialogContent sx={{ paddingTop: 4 }}>
              <div className="layout-input-barang" style={{ marginTop: 8 }}>
                <Autocomplete
                   id="combo-box-demo"
                   options={listBarang}
                   getOptionLabel={(options) => options.nama}
                   onChange={(event, value) => {
                      if (value) {
                         formik.setFieldValue("idBarang", value.id);
                      } else if (value === null) {
                         formik.setFieldValue("idBarang", "");
                      }
                   }}
                   renderInput={(params) => (
                      <TextField
                         {...params}
                         label="Barang"
                         variant="outlined"
                         size="small"
                         error={
                           formik.touched.idBarang &&
                           Boolean(formik.errors.idBarang)
                         }
                         helperText={
                           formik.touched.idBarang && formik.errors.idBarang
                         }
                      />
                   )}
                />
              </div>
Dialog/AddBarang.js
     bodyFormData.append("nama", values.nama);
     bodyFormData.append("hargaAwal", values.hargaAwal);
     bodyFormData.append("deskripsi", values.deskripsi);
     bodyFormData.append("image", values.image);
     try {
       const response = await axios.post(`${URL_API}/barang`, bodyFormData, {
         headers: {
            "Content-Type": "multipart/form-data",
            Authorization: `Bearer ${localStorage.getItem("token")}`,
         },
       });
       if (response.data.code === 200) {
         props.processAdd();
         props.closeDialog();
       }
    } catch (error) {
      console.log(error);
      console.log("ERROR");
    }
    resetForm();
  };
  return (
    <>
       <div>
         <Dialog
           open={props.open}
           onClose={props.closeDialog}
           width="xs"
           maxWidth={"xs"}
         >
           <form onSubmit={formik.handleSubmit}>
             <DialogTitle>Tambah Barang</DialogTitle>
             <DialogContent>
               <div className="layout-input-barang">
                 <TextField
                   type="text"
                   autoFocus
                   margin="dense"
                   variant="outlined"
                  fullWidth
                  id="nama"
                  label="Nama Barang"
                  name="nama"
                  size="small"
                  value={formik.values.nama || ""}
                  onChange={formik.handleChange}
                  error={formik.touched.nama && Boolean(formik.errors.nama)}
                  helperText={formik.touched.nama && formik.errors.nama}
                />
              </div>
              <div className="layout-input-barang">
                <TextField
                   type="text"
                   margin="dense"
                   variant="outlined"
                   fullWidth
                   id="hargaAwal"
                   label="Harga Awal"
                   name="hargaAwal"
                   size="small"
                   value={formik.values.hargaAwal || ""}
                   onChange={formik.handleChange}
                   error={
                     formik.touched.hargaAwal &&
Boolean(formik.errors.hargaAwal)
                   }
                   helperText={
                     formik.touched.hargaAwal && formik.errors.hargaAwal
                   }
                />
              </div>
              <div className="layout-input-barang">
                <TextField
                  multiline
                  type="text"
                  margin="dense"
                  variant="outlined"
                  fullWidth
                  rows={4}
                  id="deskripsi"
                  label="Deskripsi"
                  name="deskripsi"
                  value={formik.values.deskripsi || ""}
                  onChange={formik.handleChange}
                  error={
                    formik.touched.deskripsi &&
Boolean(formik.errors.deskripsi)
                  }
                  helperText={
                    formik.touched.deskripsi && formik.errors.deskripsi
                        }
                     />
                   </div>
Dialog/EditBarang.js
 import {
   Dialog,
   DialogTitle,
  DialogContent,
  TextField,
  DialogActions,
  Button,
} from "@mui/material";
    bodyFormData.append("id", values.id);
    bodyFormData.append("nama", values.nama);
    bodyFormData.append("tgl", values.tgl);
    bodyFormData.append("hargaAwal", values.hargaAwal);
    bodyFormData.append("deskripsi", values.deskripsi);
    bodyFormData.append("image", values.image);
    props.processEdit(bodyFormData);
  };
  return (
    <>
       <Dialog open={props.open} onClose={props.closeDialog} maxWidth="xs">
         <form onSubmit={formik.handleSubmit}>
           <DialogTitle>Tambah Barang</DialogTitle>
           <DialogContent>
             <div className="layout-input-barang">
               <TextField
                  type="text"
                  autoFocus
                  margin="dense"
                  variant="outlined"
                  fullWidth
                  id="nama"
                  label="Nama Barang"
                  name="nama"
                  size="small"
                  value={formik.values.nama || ""}
                  onChange={formik.handleChange}
                  error={formik.touched.nama && Boolean(formik.errors.nama)}
                  helperText={formik.touched.nama && formik.errors.nama}
               />
             </div>
            <div className="layout-input-barang">
              <TextField
                 type="text"
                 margin="dense"
                 variant="outlined"
                 fullWidth
                 id="hargaAwal"
                 label="Harga Awal"
                 name="hargaAwal"
                 size="small"
                 value={formik.values.hargaAwal || ""}
                 onChange={formik.handleChange}
                 error={
                   formik.touched.hargaAwal &&
Boolean(formik.errors.hargaAwal)
                 }
                 helperText={formik.touched.hargaAwal &&
formik.errors.hargaAwal}
              />
            </div>
            <div className="layout-input-barang">
              <TextField
                type="text"
                margin="dense"
                variant="outlined"
                fullWidth
                InputProps={{ readOnly: true }}
                className="readOnly"
                id="tgl"
                label="Tanggal Penambahan"
                name="tgl"
                size="small"
                value={formik.values.tgl || ""}
                onChange={formik.handleChange}
                error={formik.touched.tgl && Boolean(formik.errors.tgl)}
                helperText={formik.touched.tgl && formik.errors.tgl}
              />
            </div>
            <div className="layout-input-barang">
              <TextField
                 multiline
                 type="text"
                 margin="dense"
                 variant="outlined"
                 fullWidth
                 rows={4}
                 id="deskripsi"
                 label="Deskripsi"
                 name="deskripsi"
                 value={formik.values.deskripsi || ""}
                 onChange={formik.handleChange}
                 error={
                   formik.touched.deskripsi &&
Boolean(formik.errors.deskripsi)
                 }
                 helperText={formik.touched.deskripsi &&
formik.errors.deskripsi}
              />
            </div>
Dialog/DeleteBarang.js
   return (
     <>
        <Dialog
          open={open}
          onClose={closeDialog}
          aria-labelledby="alert-dialog-title"
          aria-describedby="alert-dialog-description"
        >
          <DialogTitle id="alert-dialog-title">Hapus Barang</DialogTitle>
          <DialogContent>
            <DialogContentText id="alert-dialog-description">
              Are you sure want to delete this list? This action can not be
               undone.
             </DialogContentText>
           </DialogContent>
           <DialogActions
             sx={{ background: "#F1F5F5", padding: "12px", paddingRight: "20px"
 }}
           >
               <Button onClick={closeDialog}>Cancel</Button>
               <Button
                 color="error"
                 variant="contained"
                 onClick={processDelete}
                 sx={{ width: "110px", boxShadow: "none", letterSpacing:
 "0.5px" }}
               >
              Delete
            </Button>
          </DialogActions>
        </Dialog>
      </>
   );
 };
Component/search.js
Components/table/tableLelang.js
        setDataLelang(allData);
      }
    } catch (error) {
      console.log(error);
    }
  };
data["barang"].nama.toLowerCase().includes(keywordChange.toLowerCase())
    );
  });
  useEffect(() => {
    getAllData();
  }, [props.reload]);
  return (
    <>
        <Paper sx={{ width: "100%", overflow: "hidden", boxShadow: "none" }}>
          <TableContainer sx={{ maxHeight: "55vh" }}>
            <Table aria-label="collapsible table">
              <TableHead>
                 <TableRow>
                   <TableCell />
                   <TableCell>Nama Barang</TableCell>
                   <TableCell>Harga Akhir</TableCell>
                   <TableCell align="center">Tanggal Lelang</TableCell>
                   <TableCell align="center">Status</TableCell>
                   <TableCell align="center">Tanggal Ditutup</TableCell>
                   <TableCell />
                 </TableRow>
              </TableHead>
              <TableBody>
                 {filterSearch
                   .sort(function (a, b) {
                      var textA = a.barang.nama.toUpperCase();
                      var textB = b.barang.nama.toUpperCase();
                      return textA < textB ? -1 : textA > textB ? 1 : 0;
                   })
                   .map((data, i) => (
                      <DataRowTable
                         data={data}
                         key={i}
                         index={i}
                         reloadChanges={() => getAllData()}
                      />
                   ))}
              </TableBody>
              <TableFooter></TableFooter>
            </Table>
          </TableContainer>
        </Paper>
      </>
   );
 };
Components/table/TableBarang.js
        setDataBarang(allData);
      }
    } catch (error) {
      console.log(error);
    }
  };
  useEffect(() => {
    getAllData();
  }, [props.reload]);
  return (
    <>
       <Paper sx={{ width: "100%", overflow: "hidden", boxShadow: "none" }}>
         <TableContainer sx={{ maxHeight: "55vh" }}>
           <Table aria-label="collapsible table">
             <TableHead>
               <TableRow>
                 <TableCell />
                 <TableCell>Nama Barang</TableCell>
                 <TableCell>Harga Awal</TableCell>
                   <TableCell align="center">Tanggal Penambahan</TableCell>
                   <TableCell align="center">Status</TableCell>
                   <TableCell />
                 </TableRow>
              </TableHead>
              <TableBody>
                 {filterSearch
                   .sort(function (a, b) {
                      var textA = a.nama.toUpperCase();
                      var textB = b.nama.toUpperCase();
                      return textA < textB ? -1 : textA > textB ? 1 : 0;
                   })
                   .map((data, i) => (
                      <DataRowTable
                         data={data}
                         key={i}
                         index={i}
                         reloadChanges={() => getAllData()}
                      />
                   ))}
              </TableBody>
              <TableFooter></TableFooter>
            </Table>
          </TableContainer>
        </Paper>
      </>
   );
 };
Component/list/rowLelang.js
  return (
    <>
       <EditBarang
          open={openEdit}
          data={itemSelect}
          closeDialog={() => handleCloseEdit()}
          processEdit={(payload) => fetchEditBarang(payload)}
       />
       <DeleteBarang
          open={openDelete}
          closeDialog={() => handleCloseDelete()}
          processDelete={() => fetchDeleteBarang()}
       />
       <TableRow
          sx={{
             [`& .${tableCellClasses.root}`]: {
                borderBottom: "none",
             },
          }}
       >
          <TableCell>
             <Typography sx={{ fontWeight: 500 }}>{props.index +
1}</Typography>
          </TableCell>
          <TableCell component="th" scope="row">
             <Typography sx={{ fontWeight:
500 }}>{data.barang.nama}</Typography>
          </TableCell>
          <TableCell>
             <Typography
                sx={{ fontWeight: 500 }}
             >{`Rp.${data.hargaAkhir}`}</Typography>
          </TableCell>
          <TableCell align="center">
             <Typography sx={{ fontWeight: 500 }}>
{data.tglLelang}</Typography>
          </TableCell>
          <TableCell align="center">
             {data.status === "Ditutup" ? (
                <Badge bg="light" text="danger">
                  Ditutup
                </Badge>
             ) : (
                <Badge bg="light" text="warning">
                  Dibuka
                </Badge>
             )}
           </TableCell>
           <TableCell align="center">
             <Typography sx={{ fontWeight: 500 }}>
               {data.endTime === null ? "-- -- -- --" : data.endTime}
             </Typography>
           </TableCell>
           <TableCell align="center">
             <div style={{ display: "flex", alignItems: "center" }}>
               <div className="btn-act" onClick={() => handleEditBarang(data)}>
                 <EvaIcon name="edit-2-outline" size="normal" fill="#FE2E12" />
               </div>
               <div
                 className="btn-act"
                 onClick={() => handleDeleteBarang(data.id)}
               >
                 <EvaIcon name="trash-2-outline" size="normal"
 fill="#FE2E12" />
               </div>
             </div>
           </TableCell>
         </TableRow>
       </>
    );
 };
Component/list/rowBarang.js
  useEffect(() => {
    getStatus();
  });
  return (
    <>
       <EditBarang
          open={openEdit}
          data={itemSelect}
          closeDialog={() => handleCloseEdit()}
          processEdit={(payload) => fetchEditBarang(payload)}
       />
       <DeleteBarang
          open={openDelete}
          closeDialog={() => handleCloseDelete()}
          processDelete={() => fetchDeleteBarang()}
       />
       <TableRow
          sx={{
             [`& .${tableCellClasses.root}`]: {
                borderBottom: "none",
             },
          }}
       >
          <TableCell>
             <Typography sx={{ fontWeight: 500 }}>{props.index +
1}</Typography>
          </TableCell>
           <TableCell component="th" scope="row">
             <Typography sx={{ fontWeight: 500 }}>{data.nama}</Typography>
           </TableCell>
           <TableCell>
             <Typography
                sx={{ fontWeight: 500 }}
             >{`Rp.${data.hargaAwal}`}</Typography>
           </TableCell>
           <TableCell align="center">
             <Typography sx={{ fontWeight: 500 }}> {data.tgl}</Typography>
           </TableCell>
           <TableCell align="center">
             {!onLelang ? (
                <Badge bg="light" text="success">
                  Tidak dilelang
                </Badge>
             ) : (
                <Badge bg="light" text="warning">
                  Sedang dilelang
                </Badge>
             )}
           </TableCell>
           <TableCell align="center">
             <div style={{ display: "flex", alignItems: "center" }}>
                <div className="btn-act" onClick={() => handleEditBarang(data)}>
                  <EvaIcon name="edit-2-outline" size="normal" fill="#FE2E12" />
                </div>
                <div
                  className="btn-act"
                  onClick={() => handleDeleteBarang(data.id)}
                >
                  <EvaIcon name="trash-2-outline" size="normal"
 fill="#FE2E12" />
                </div>
             </div>
           </TableCell>
         </TableRow>
       </>
    );
 };
Index.css
 .historyCard {
   border-radius: 8px;
   display: flex;
   flex-wrap: wrap;
   align-items: center;
    padding: 12px;
    transition: 0.7s all ease;
}
.historyCard:hover {
  background-color: white;
}
.historyCol {
  color: grey;
  font-size: 18px;
  font-weight: 500;
  padding: 8px;
}
#name {
  width: 200px;
  margin-left: 24px;
}
#date {
  width: 170px;
}
#price {
  width: 150px;
  text-align: "center";
}
#completed {
  width: 170px;
  text-align: "center";
}
#title-user {
  color: rgb(187, 187, 187);
  font-size: 15px;
  font-weight: 500;
}
#text-user {
  font-size: 20px;
  font-weight: 600;
  text-transform: capitalize;
}
.textError {
  font-size: 12px;
  margin-left: 8px;
  opacity: 0.7;
}
.textMovePageLogin {
    display: flex;
    margin-top: 16px;
    justify-content: center;
    font-size: 14px;
}
.btn-act {
  margin: 0px 8px;
  cursor: pointer;
}
.layout-input-barang {
  width: 552px;
  max-width: 100%;
}
.readOnly {
  background-color: #f0f0f0;
}