remove import & create button dashboard
This commit is contained in:
@@ -30,7 +30,7 @@ import { Add as AddIcon } from '@mui/icons-material';
|
|||||||
/* ---------------------------------- axios --------------------------------- */
|
/* ---------------------------------- axios --------------------------------- */
|
||||||
import axios from '../../utils/axios';
|
import axios from '../../utils/axios';
|
||||||
/* ---------------------------------- react --------------------------------- */
|
/* ---------------------------------- react --------------------------------- */
|
||||||
import { useContext, useEffect, useRef, useState } from 'react';
|
import { useContext, useEffect, useState } from 'react';
|
||||||
/* -------------------------------- component ------------------------------- */
|
/* -------------------------------- component ------------------------------- */
|
||||||
import Iconify from '../../components/Iconify';
|
import Iconify from '../../components/Iconify';
|
||||||
import BaseTablePagination from '../../components/BaseTablePagination';
|
import BaseTablePagination from '../../components/BaseTablePagination';
|
||||||
@@ -212,7 +212,6 @@ export default function TableList(props: any) {
|
|||||||
};
|
};
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
/* ----------------------------- Field Container ---------------------------- */
|
|
||||||
/* ----------------------------- division field ----------------------------- */
|
/* ----------------------------- division field ----------------------------- */
|
||||||
const [divisionValue, setDivisionValue] = useState('all');
|
const [divisionValue, setDivisionValue] = useState('all');
|
||||||
const [divisionData, setDivisionData] = useState([]);
|
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 ------------------------ */
|
/* ------------------------ button change pagination ------------------------ */
|
||||||
const onPageChangeHandle = async (
|
const onPageChangeHandle = async (
|
||||||
event: React.MouseEvent<HTMLButtonElement> | null,
|
event: React.MouseEvent<HTMLButtonElement> | null,
|
||||||
@@ -304,7 +281,6 @@ export default function TableList(props: any) {
|
|||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
};
|
};
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* -------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
@@ -355,7 +331,7 @@ export default function TableList(props: any) {
|
|||||||
</Select>
|
</Select>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} lg={5} xl={6}>
|
<Grid item xs={12} lg={9} xl={10}>
|
||||||
<form onSubmit={handleSearchSubmit}>
|
<form onSubmit={handleSearchSubmit}>
|
||||||
<TextField
|
<TextField
|
||||||
id="search-input"
|
id="search-input"
|
||||||
@@ -367,38 +343,6 @@ export default function TableList(props: any) {
|
|||||||
/>
|
/>
|
||||||
</form>
|
</form>
|
||||||
</Grid>
|
</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>
|
||||||
</Grid>
|
</Grid>
|
||||||
{/* End Field 1 */}
|
{/* End Field 1 */}
|
||||||
|
|||||||
Reference in New Issue
Block a user