aboutsummaryrefslogtreecommitdiff
path: root/src/components/BillingPage.js
blob: 06a80a602fdc0a0fc3991d923995690fc8be5787 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import React, { useState, useEffect } from "react";
import AddNewItemForm from "./Form/AddNewItemForm";
import ItemsDisplay from "./Display/ItemsDisplay";
import SummaryDisplay from "./Display/SummaryDisplay";

const sampleData = [
  {
    "Model": "Kisan Chair",
    "Description": "Very good chair",
    "Price": 10000,
    "HSN": 9403
  }, {
    "Model": "Supreme Chair",
    "Description": "Even better chair",
    "Price": "2134983",
    "HSN": 9403
  }, {
    "Model": "Action Houseware",
    "Description": "Not a chair",
    "Price": 69,
    "HSN": 69
  }, {
    "Model": "Coirfit Mattress",
    "Description": "Not a chair (neither houseware)",
    "Price": 19,
    "HSN": 420
  }, {
    "Model": "AVRO Chair",
    "Description": "Formerly AVON lol",
    "Price": 291,
    "HSN": 9403
  }, {
    "Model": "Mystery Item",
    "Description": "hehe heheheheheh",
    "Price": 1212312,
    "HSN": 42069
  }
];

const BillingPage = () => {
  useEffect(() => {
    alert("yo this app in beta");
  }, []);
  // to be handled by backend
  const defGSTValue = 18;

  const [items, setItems] = useState([]);
  const getItems = (item) => {
    setItems(
      [...items, item]
    );
  };

  useEffect(() => {
  }, [items]);

  return (
    <div>
      <AddNewItemForm savedItems={sampleData} addItem={getItems} defGSTValue={defGSTValue}/>
      <ItemsDisplay items={items} defGSTValue={defGSTValue}/>
      <SummaryDisplay items={items}/>
    </div>
  );
}

export default BillingPage;