-
-
Save luizhenriquesoares/0ffc6b933bc810a1e7692e4936d22845 to your computer and use it in GitHub Desktop.
table dymanic react
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { Segment, Tab, Icon, Table, Image } from "semantic-ui-react"; | |
import { graphql, compose } from "react-apollo"; | |
import { connect } from 'react-redux'; | |
import { withApollo } from 'react-apollo'; | |
import gql from 'graphql-tag'; | |
import getUserCache from '../../../graphql/query/currentUser.graphql'; | |
import smiles from "../../../graphql/mutation/getSmiles.graphql"; | |
import airports from "../../../graphql/mutation/getAirports.graphql"; | |
require('./scss/result-table.scss'); | |
const ResultTable = (data) => ( | |
<Table className="tabela-buscador tabela-voos" compact> | |
<Table.Header> | |
<Table.Row> | |
<Table.HeaderCell className="link-cabecalho-tabela">VOO</Table.HeaderCell> | |
<Table.HeaderCell className="link-cabecalho-tabela">ORIGEM</Table.HeaderCell> | |
<Table.HeaderCell className="link-cabecalho-tabela">PARTIDA</Table.HeaderCell> | |
<Table.HeaderCell className="link-cabecalho-tabela">DURACÃO</Table.HeaderCell> | |
<Table.HeaderCell className="link-cabecalho-tabela">CHEGADA</Table.HeaderCell> | |
<Table.HeaderCell className="link-cabecalho-tabela">DESTINO</Table.HeaderCell> | |
<Table.HeaderCell className="link-cabecalho-tabela pontos">PONTOS</Table.HeaderCell> | |
<Table.HeaderCell className="link-cabecalho-tabela pontos">CIA. AERÉA</Table.HeaderCell> | |
<Table.HeaderCell className="link-cabecalho-tabela pontos">PREÇO MAIS MILHAS</Table.HeaderCell> | |
</Table.Row> | |
</Table.Header> | |
<Table.Body> | |
{ | |
data.data.smiles.passagens.map((row, j) => { | |
return ( | |
<Table.Row key={j}> | |
{ | |
row.opcoesIda.map((rowOpcaoIda, i) => { | |
return ( | |
<Table.Cell><Image size='tiny' src='../../../../assets/img/multiplus.png' />JJ35</Table.Cell> | |
<Table.Cell key={i}>{rowOpcaoIda.origem}</Table.Cell> | |
<Table.Cell>17:30</Table.Cell> | |
<Table.Cell>1 parada</Table.Cell> | |
<Table.Cell>00:31</Table.Cell> | |
<Table.Cell>CWB</Table.Cell> | |
<Table.Cell>35.000</Table.Cell> | |
<Table.Cell>R$ 586,00</Table.Cell> | |
<Table.Cell>R$ 3000,00</Table.Cell> | |
) | |
}) | |
} | |
</Table.Row> | |
) | |
}) | |
} | |
</Table.Body> | |
</Table> | |
) | |
export default ResultTable; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment