aboutsummaryrefslogtreecommitdiff
path: root/src/components/Display/ItemsDisplay.js
blob: 0545ef0290444b163baf9d473d93957fc45e81ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from "react";
import "./Display.css";
import DisplayItem from "./DisplayItem";
import SummaryDisplayTR from "./SummaryDisplay";

const ItemsDisplay = (props) => {
  const items = props.items;
  let itemNumber = 0;


  return (
    <table className={"ItemsDisplay"}>
      <tr className="legend">
        <th>S. Num</th>
        <th className={"leftAlign"}>Item</th>
        <th className={"leftAlign"}>Description</th>
        <th>Quantity(NOS)</th>
        <th>Price</th>
        <th>Discount(%)</th>
        <th>GST(%)</th>
      </tr>

      {items.map( 
        (item) => {
          itemNumber++
          return (
            <DisplayItem itemNumber={itemNumber} item={item}/>
          );
        }
      )}

      <SummaryDisplayTR items={props.items}/>
    </table>
  );
}

export default ItemsDisplay;