Lamassu admin server initial commit
This commit is contained in:
parent
d083ae5a40
commit
fc1951c4b2
158 changed files with 28462 additions and 1606 deletions
32
new-lamassu-admin/src/components/editableTable/Table.js
Normal file
32
new-lamassu-admin/src/components/editableTable/Table.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import React from 'react'
|
||||
import { startCase } from 'lodash/fp'
|
||||
|
||||
import {
|
||||
Td,
|
||||
THead,
|
||||
TBody,
|
||||
Table
|
||||
} from '../fake-table/Table'
|
||||
|
||||
import ERow from './Row'
|
||||
|
||||
const ETable = ({ elements = [], data = [], cancel, save, components = {} }) => {
|
||||
const { row } = components
|
||||
const Row = row || ERow
|
||||
|
||||
return (
|
||||
<Table>
|
||||
<THead>
|
||||
{elements.map(({ name, size, header }, idx) => (
|
||||
<Td header key={idx} size={size}>{header || startCase(name)}</Td>
|
||||
))}
|
||||
<Td header size={175} />
|
||||
</THead>
|
||||
<TBody>
|
||||
{data.map((it, idx) => <Row key={idx} value={it} elements={elements} cancel={cancel} save={save} />)}
|
||||
</TBody>
|
||||
</Table>
|
||||
)
|
||||
}
|
||||
|
||||
export default ETable
|
||||
Loading…
Add table
Add a link
Reference in a new issue