Skip to content
Snippets Groups Projects
Commit 689827e6 authored by nico20's avatar nico20
Browse files

una tabla mas

parent 2edc0359
No related branches found
No related tags found
No related merge requests found
import { Autocomplete, Button, Stack, TextField } from "@mui/material";
import {
Autocomplete,
Button,
Table,
TableCell,
TableRow,
TextField,
styled,
} from "@mui/material";
import { useState } from "react";
import { useLazyReadCypher, useReadCypher } from "use-neo4j";
const TableCellBlack = styled(TableCell)({
fontWeight: "bold",
});
const ElMasPopu = () => {
const query = `MATCH (p:Player {gender: "Male"}) RETURN p limit 100`;
const queryCompanerosPorJugador = `CALL {
......@@ -76,23 +88,29 @@ const ElMasPopu = () => {
>
Buscar
</Button>
{companerosQueryState.result &&
companerosQueryState.result.records.map((record, index) => {
const team_name = record.get("team_name");
const total_companeros_en_club = record
.get("total_companeros_en_club")
.toNumber();
return (
<Stack flexDirection="row" key={team_name + index}>
<Stack>
<p>
Total de compañeros en {team_name}: {total_companeros_en_club}{" "}
- Edicion: {record.get("edition")}
</p>
</Stack>
</Stack>
);
})}
{companerosQueryState.result && (
<Table>
<TableRow>
<TableCellBlack>Club</TableCellBlack>
<TableCellBlack>Total de compañeros</TableCellBlack>
<TableCellBlack>Edicion</TableCellBlack>
</TableRow>
{companerosQueryState.result.records.map((record, index) => {
const team_name = record.get("team_name");
const total_companeros_en_club = record
.get("total_companeros_en_club")
.toNumber();
const edition = record.get("edition");
return (
<TableRow>
<TableCell>{team_name}</TableCell>
<TableCell>{total_companeros_en_club}</TableCell>
<TableCell>{edition}</TableCell>
</TableRow>
);
})}
</Table>
)}
</>
);
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment