feat: notifications rework
This commit is contained in:
parent
b6e7d98b72
commit
ffa8713ee4
77 changed files with 2281 additions and 3269 deletions
35
new-lamassu-admin/src/components/editableTable/Header.js
Normal file
35
new-lamassu-admin/src/components/editableTable/Header.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import React from 'react'
|
||||
|
||||
import { Td, THead } from 'src/components/fake-table/Table'
|
||||
import { startCase } from 'src/utils/string'
|
||||
|
||||
import { ACTION_COL_SIZE, DEFAULT_COL_SIZE } from './consts'
|
||||
|
||||
const Header = ({ elements, enableEdit, enableDelete }) => {
|
||||
const actionColSize =
|
||||
enableDelete && enableEdit ? ACTION_COL_SIZE / 2 : ACTION_COL_SIZE
|
||||
|
||||
return (
|
||||
<THead>
|
||||
{elements.map(
|
||||
({ name, width = DEFAULT_COL_SIZE, header, textAlign }, idx) => (
|
||||
<Td header key={idx} width={width} textAlign={textAlign}>
|
||||
{header || startCase(name)}
|
||||
</Td>
|
||||
)
|
||||
)}
|
||||
{enableEdit && (
|
||||
<Td header width={actionColSize} textAlign="right">
|
||||
Edit
|
||||
</Td>
|
||||
)}
|
||||
{enableDelete && (
|
||||
<Td header width={actionColSize} textAlign="right">
|
||||
Delete
|
||||
</Td>
|
||||
)}
|
||||
</THead>
|
||||
)
|
||||
}
|
||||
|
||||
export default Header
|
||||
Loading…
Add table
Add a link
Reference in a new issue