From 74281891aec3ee39357147cbf5e7c41301d6a64d Mon Sep 17 00:00:00 2001 From: ekallin Date: Tue, 19 Dec 2023 15:42:57 +0400 Subject: [PATCH] some additionals: lines table and other --- src/components/adminTable/LineTable.jsx | 44 ++++++++++++++++++ src/components/adminTable/LinesTableRow.jsx | 49 +++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 src/components/adminTable/LineTable.jsx create mode 100644 src/components/adminTable/LinesTableRow.jsx diff --git a/src/components/adminTable/LineTable.jsx b/src/components/adminTable/LineTable.jsx new file mode 100644 index 0000000..5b53c01 --- /dev/null +++ b/src/components/adminTable/LineTable.jsx @@ -0,0 +1,44 @@ +import PropTypes from 'prop-types'; +import { Table } from 'react-bootstrap'; + +const LinesTable = ({ children }) => { + return ( + + {/* + + + + + + + + + + + */} + + + + + + + + + + {children} + +
ТоварЦенаКолич.Сумма
НазваниеЖанр + Описание + + Длительность + + Действие +
+ ); +}; + +LinesTable.propTypes = { + children: PropTypes.node, +}; + +export default LinesTable; diff --git a/src/components/adminTable/LinesTableRow.jsx b/src/components/adminTable/LinesTableRow.jsx new file mode 100644 index 0000000..bae79d0 --- /dev/null +++ b/src/components/adminTable/LinesTableRow.jsx @@ -0,0 +1,49 @@ +import PropTypes from 'prop-types'; +import { PencilSquare, TrashFill } from 'react-bootstrap-icons'; + + +const LinesTableRow = ({ + index, line, onDelete, onEdit, +}) => { + const handleAnchorClick = (event, action) => { + event.preventDefault(); + action(); + }; + return ( + // + // {index + 1} + // {line.type.name} + // {parseFloat(line.price).toFixed(2)} + // {line.count} + // {parseFloat(line.sum).toFixed(2)} + // handleAnchorClick(event, onEdit)}> + // handleAnchorClick(event, onEditInPage)}> + // handleAnchorClick(event, onDelete)}> + // + + + + {index + 1} + {/* 1 */} + {line.type.name} + {line.type.category} + {line.type.description} + {line.type.time} + + + handleAnchorClick(event, onEdit)}> + handleAnchorClick(event, onDelete)}> + + + + ); +}; + +LinesTableRow.propTypes = { + index: PropTypes.number, + line: PropTypes.object, + onDelete: PropTypes.func, + onEdit: PropTypes.func, +}; + +export default LinesTableRow; \ No newline at end of file