mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-23 11:00:27 +03:00
3139152cb1
# Conflicts: # packages/ui/src/views/canvas/index.jsx # packages/ui/src/views/chatflows/APICodeDialog.jsx # packages/ui/src/views/chatmessage/ChatMessage.jsx
36 lines
1.3 KiB
React
36 lines
1.3 KiB
React
import PropTypes from 'prop-types'
|
|
import { TableContainer, Table, TableHead, TableCell, TableRow, TableBody, Paper } from '@mui/material'
|
|
|
|
export const TableViewOnly = ({ columns, rows, sx }) => {
|
|
return (
|
|
<>
|
|
<TableContainer component={Paper}>
|
|
<Table sx={{ minWidth: 650, ...sx }} aria-label='simple table'>
|
|
<TableHead>
|
|
<TableRow>
|
|
{columns.map((col, index) => (
|
|
<TableCell key={index}>{col.charAt(0).toUpperCase() + col.slice(1)}</TableCell>
|
|
))}
|
|
</TableRow>
|
|
</TableHead>
|
|
<TableBody>
|
|
{rows.map((row, index) => (
|
|
<TableRow key={index} sx={{ '&:last-child td, &:last-child th': { border: 0 } }}>
|
|
{Object.keys(row).map((key, index) => (
|
|
<TableCell key={index}>{row[key]}</TableCell>
|
|
))}
|
|
</TableRow>
|
|
))}
|
|
</TableBody>
|
|
</Table>
|
|
</TableContainer>
|
|
</>
|
|
)
|
|
}
|
|
|
|
TableViewOnly.propTypes = {
|
|
rows: PropTypes.array,
|
|
columns: PropTypes.array,
|
|
sx: PropTypes.object
|
|
}
|