revoked changes
This commit is contained in:
parent
5d0bba824f
commit
995643abd5
@ -9,7 +9,6 @@ import TablePagination from '@mui/material/TablePagination';
|
||||
import TableRow from '@mui/material/TableRow';
|
||||
import { Button } from '@mui/material';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { useState } from 'react';
|
||||
|
||||
const columns = [
|
||||
{
|
||||
@ -55,14 +54,37 @@ const columns = [
|
||||
},
|
||||
];
|
||||
|
||||
type Props={
|
||||
projectData:any
|
||||
}
|
||||
|
||||
const ProjectTableHead = () => (
|
||||
|
||||
export default function ProjectList({projectData}:Props) {
|
||||
const [page, setPage] = React.useState(0);
|
||||
const [rowsPerPage, setRowsPerPage] = React.useState(10);
|
||||
|
||||
const handleChangePage = (event:any, newPage:any) => {
|
||||
setPage(newPage);
|
||||
};
|
||||
|
||||
const handleChangeRowsPerPage = (event:any) => {
|
||||
setRowsPerPage(+event.target.value);
|
||||
setPage(0);
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<Paper square className='projectScreen-background' sx={{ width: '100%', overflow: 'hidden',backgroundColor:'rgb(13 13 13)' }}>
|
||||
<Paper className='projectScreen-background' sx={{ margin:'1%', width: '100%', overflow: 'hidden' }}>
|
||||
<TableContainer sx={{ maxHeight: '600px'}}>
|
||||
<Table stickyHeader aria-label="sticky table">
|
||||
<TableHead >
|
||||
<TableRow >
|
||||
{columns.map((column) => (
|
||||
<TableCell
|
||||
sx={{bgcolor:'#171716',color:'white', borderBottom:'#171716'}}
|
||||
key={column.id}
|
||||
// align={column.align}
|
||||
style={{ minWidth: column.minWidth }}
|
||||
>
|
||||
{column.label}
|
||||
@ -70,53 +92,29 @@ const ProjectTableHead = () => (
|
||||
))}
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
);
|
||||
|
||||
type Props = {
|
||||
projectData: any;
|
||||
page:any;
|
||||
rowsPerPage:any
|
||||
};
|
||||
|
||||
const ProjectTable = ({ projectData, page, rowsPerPage }:Props) => (
|
||||
<Table stickyHeader aria-label="sticky table">
|
||||
<TableBody>
|
||||
{projectData &&
|
||||
projectData
|
||||
{projectData && projectData
|
||||
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
|
||||
.map((row:any) => (
|
||||
.map((row:any) => {
|
||||
return (
|
||||
<TableRow hover role="checkbox" tabIndex={-1} key={row.code}>
|
||||
{columns.map((column) => (
|
||||
<TableCell key={column.id}>{ typeof row[column.id] === 'number' ? (row[column.id]) : row[column.id]}</TableCell>
|
||||
))}
|
||||
{columns.map((column:any) => {
|
||||
const value = row[column.id];
|
||||
return (
|
||||
<TableCell key={column.id}
|
||||
// align={column.align}
|
||||
>
|
||||
{column.format && typeof value === 'number'
|
||||
? column.format(value)
|
||||
: value}
|
||||
</TableCell>
|
||||
);
|
||||
})}
|
||||
</TableRow>
|
||||
))}
|
||||
);
|
||||
})}
|
||||
</TableBody>
|
||||
</Table>
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
const ProjectList = ({ projectData}: any) => {
|
||||
const [page, setPage] = useState(0);
|
||||
const [rowsPerPage, setRowsPerPage] = useState(10);
|
||||
|
||||
const handleChangePage = (event: any, newPage: React.SetStateAction<number>) => {
|
||||
setPage(newPage);
|
||||
};
|
||||
|
||||
const handleChangeRowsPerPage = (event: { target: { value: string | number; }; }) => {
|
||||
setRowsPerPage(+event.target.value);
|
||||
setPage(0);
|
||||
};
|
||||
|
||||
return (
|
||||
<Paper square className="projectScreen-background" sx={{ width: '100%', overflow: 'hidden', backgroundColor: 'rgb(13 13 13)' }}>
|
||||
<Paper className="projectScreen-background" sx={{ margin: '1%', width: '100%', overflow: 'hidden' }}>
|
||||
<TableContainer sx={{ maxHeight: '600px' }}>
|
||||
<ProjectTableHead />
|
||||
<ProjectTable projectData={projectData} page={page} rowsPerPage={rowsPerPage} />
|
||||
</TableContainer>
|
||||
<TablePagination
|
||||
sx={{bgcolor:'#171716',color:'white'}}
|
||||
@ -131,6 +129,4 @@ const ProjectList = ({ projectData}: any) => {
|
||||
</Paper>
|
||||
</Paper>
|
||||
);
|
||||
};
|
||||
|
||||
export default ProjectList;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user