aboutsummaryrefslogtreecommitdiff
path: root/src/components/Display/ItemsDisplay.tsx
diff options
context:
space:
mode:
authorMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-08-29 11:40:15 +0530
committerMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-08-29 11:40:15 +0530
commit6f625bb9741b90ea5272914bf7958eed0f42e885 (patch)
treeb3b0d33f0cab7983710bc2deb1f22f139eddac94 /src/components/Display/ItemsDisplay.tsx
parent20b48b0003f198ef51eb982735526011f59c511d (diff)
Fixed SummaryDisplayTR
Diffstat (limited to 'src/components/Display/ItemsDisplay.tsx')
-rw-r--r--src/components/Display/ItemsDisplay.tsx13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/components/Display/ItemsDisplay.tsx b/src/components/Display/ItemsDisplay.tsx
index 78c5094..79eed40 100644
--- a/src/components/Display/ItemsDisplay.tsx
+++ b/src/components/Display/ItemsDisplay.tsx
@@ -10,7 +10,7 @@ import React from "react";
import { Item } from "./../../interfaces";
import "./Display.scss";
import DisplayItem from "./DisplayItem";
-// import {SummaryDisplayTR} from "./SummaryDisplay";
+import {SummaryDisplayTR} from "./SummaryDisplay";
interface Props {
items: Item[]
@@ -19,9 +19,6 @@ interface Props {
const ItemsDisplay: React.FC<Props> = (props) => {
const items = props.items;
- // TODO: remove mutability
- let itemNumber = 0;
-
return (
<table className={"ItemsDisplay"}>
<tbody>
@@ -38,19 +35,17 @@ const ItemsDisplay: React.FC<Props> = (props) => {
</tr>
{items.map(
- (item) => {
- itemNumber++
+ (item, index) => {
return (
- <DisplayItem key={itemNumber} itemNumber={itemNumber} item={item} defGSTValue={props.defGSTValue}/>
+ <DisplayItem key={index + 1} itemNumber={index + 1} item={item} defGSTValue={props.defGSTValue}/>
);
}
)}
+ <SummaryDisplayTR items={props.items}/>
</tbody>
</table>
);
- // this goes right before </tbody>
- //<SummaryDisplayTR items={props.items}/>
}
export default ItemsDisplay;