import * as React from 'react';
import Table from '@mui/material/Table';
import TableBody from '@mui/material/TableBody';
import TableCell from '@mui/material/TableCell';
import TableContainer from '@mui/material/TableContainer';
import TableHead from '@mui/material/TableHead';
import TableRow from '@mui/material/TableRow';
import Paper from '@mui/material/Paper';
import { TableVirtuoso } from 'react-virtuoso';
import Chance from 'chance';
const chance = new Chance(42);
function createData(id) {
return {
id,
firstName: chance.first(),
lastName: chance.last(),
age: chance.age(),
phone: chance.phone(),
state: chance.state({ full: true }),
};
}
const columns = [
{
width: 100,
label: 'First Name',
dataKey: 'firstName',
},
{
width: 100,
label: 'Last Name',
dataKey: 'lastName',
},
{
width: 50,
label: 'Age',
dataKey: 'age',
numeric: true,
},
{
width: 110,
label: 'State',
dataKey: 'state',
},
{
width: 130,
label: 'Phone Number',
dataKey: 'phone',
},
];
const rows = Array.from({ length: 200 }, (_, index) => createData(index));
const VirtuosoTableComponents = {
Scroller: React.forwardRef((props, ref) => (