// material-ui import * as React from 'react'; import { DataGrid, GridActionsCellItem, } from "@mui/x-data-grid"; import EditIcon from '@mui/icons-material/Edit'; import {useEffect} from "react"; import {useNavigate} from "react-router-dom"; import { useTheme } from '@mui/material/styles'; import Checkbox from '@mui/material/Checkbox'; // ==============================|| EVENT TABLE ||============================== // export default function UserTable({recordList}) { const [rows, setRows] = React.useState(recordList); const [rowModesModel] = React.useState({}); const theme = useTheme(); const navigate = useNavigate() useEffect(() => { setRows(recordList); }, [recordList]); const handleEditClick = (id) => () => { navigate('/user/'+ id); }; const columns = [ { field: 'actions', type: 'actions', headerName: 'Actions', width: 100, cellClassName: 'actions', getActions: ({id}) => { return [ } label="Edit" className="textPrimary" onClick={handleEditClick(id)} color="primary" />] }, }, { id: 'username', field: 'username', headerName: 'User Name', flex: 1, }, { id: 'name', field: 'name', headerName: 'Full Name', flex: 1, }, { id: 'post', field: 'post', headerName: 'Post', flex: 1, }, { id: 'email', field: 'email', headerName: 'Email', flex: 1, }, { id: 'subDivisionId', field: 'subDivisionId', //type: 'date', //sortable: false, headerName: 'Sub-Division', flex: 1, }, // { // id: 'subDivisionId', // field: 'subDivisionId', // //type: 'date', // //sortable: false, // headerName: 'Sub-Division', // flex: 1, // }, // { // id: 'lotusNotesUser', // field: 'lotusNotesUser', // type: 'bool', // headerName: 'Lotus Notes User', // flex: 1, // renderCell: (params) => { // return ( // // ); // }, // }, { id: 'locked', field: 'locked', type: 'bool', headerName: 'Locked', flex: 1, renderCell: (params) => { return ( ); }, }, ]; return (
); }