test-crud
Version:
es una prueba acerca de como publicar un package name
44 lines (39 loc) • 1.04 kB
JSX
import Image from "next/image";
import AppButton from "../inputs/button";
import AddIcon from "@mui/icons-material/Add";
import { DataGrid as MuiDataGrid } from "@mui/x-data-grid";
function AppDataGrid({ rows, columns, addLabel, addClick, ...rest }) {
if (!rows || rows.length === 0)
return (
<div className="empty">
<Image src="/empty.png" width={330} height={220} />
<div>
{addLabel && addClick && (
<AppButton
label={addLabel}
startIcon={<AddIcon />}
onClick={addClick}
{ ...rest}
/>
)}
</div>
</div>
);
return (
<>
<div>
{addLabel && addClick && (
<AppButton
label={addLabel}
startIcon={<AddIcon />}
onClick={addClick}
/>
)}
</div>
<div style={{ width: "100%" }}>
<MuiDataGrid autoHeight rows={rows} columns={columns} {...rest} />
</div>
</>
);
}
export default AppDataGrid;