remove import & create button dashboard

This commit is contained in:
Muhammad Fajar
2022-12-08 08:59:42 +07:00
parent 9526092860
commit 7a421e0619

View File

@@ -30,7 +30,7 @@ import { Add as AddIcon } from '@mui/icons-material';
/* ---------------------------------- axios --------------------------------- */
import axios from '../../utils/axios';
/* ---------------------------------- react --------------------------------- */
import { useContext, useEffect, useRef, useState } from 'react';
import { useContext, useEffect, useState } from 'react';
/* -------------------------------- component ------------------------------- */
import Iconify from '../../components/Iconify';
import BaseTablePagination from '../../components/BaseTablePagination';
@@ -212,7 +212,6 @@ export default function TableList(props: any) {
};
/* -------------------------------------------------------------------------- */
/* ----------------------------- Field Container ---------------------------- */
/* ----------------------------- division field ----------------------------- */
const [divisionValue, setDivisionValue] = useState('all');
const [divisionData, setDivisionData] = useState([]);
@@ -253,28 +252,6 @@ export default function TableList(props: any) {
};
/* -------------------------------------------------------------------------- */
/* ------------------------------ import button ----------------------------- */
const [currentImportFileName, setCurrentImportFileName] = useState(null);
const importForm = useRef<HTMLInputElement>(null);
const handleImportChange = (event: any) => {
if (event.target.files[0]) {
setCurrentImportFileName(event.target.files[0].name);
} else {
setCurrentImportFileName(null);
}
};
/* -------------------------------------------------------------------------- */
/* ------------------------------ create button ----------------------------- */
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
setAnchorEl(event.currentTarget);
};
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* ---------------------------- table pagination ---------------------------- */
/* ------------------------ button change pagination ------------------------ */
const onPageChangeHandle = async (
event: React.MouseEvent<HTMLButtonElement> | null,
@@ -304,7 +281,6 @@ export default function TableList(props: any) {
setIsLoading(false);
};
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
useEffect(() => {
(async () => {
@@ -355,7 +331,7 @@ export default function TableList(props: any) {
</Select>
</FormControl>
</Grid>
<Grid item xs={12} lg={5} xl={6}>
<Grid item xs={12} lg={9} xl={10}>
<form onSubmit={handleSearchSubmit}>
<TextField
id="search-input"
@@ -367,38 +343,6 @@ export default function TableList(props: any) {
/>
</form>
</Grid>
<Grid item xs={12} lg={2} xl={2}>
<Button
id="import-button"
variant="outlined"
startIcon={<Iconify icon="material-symbols:download-rounded" />}
component="label"
fullWidth
sx={{ height: '100%' }}
>
Import
<input
type="file"
id="file"
ref={importForm}
style={{ display: 'none' }}
onChange={handleImportChange}
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, text/plain"
/>
</Button>
</Grid>
<Grid item xs={12} lg={2} xl={2}>
<Button
id="import-button"
variant="contained"
startIcon={<AddIcon />}
onClick={handleClick}
fullWidth
sx={{ height: '100%' }}
>
Add Data
</Button>
</Grid>
</Grid>
</Grid>
{/* End Field 1 */}