aboutsummaryrefslogtreecommitdiff
path: root/src/components/Form/Address/NewAddressPane.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/Form/Address/NewAddressPane.tsx')
-rw-r--r--src/components/Form/Address/NewAddressPane.tsx69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/components/Form/Address/NewAddressPane.tsx b/src/components/Form/Address/NewAddressPane.tsx
new file mode 100644
index 0000000..4dd3788
--- /dev/null
+++ b/src/components/Form/Address/NewAddressPane.tsx
@@ -0,0 +1,69 @@
+/*
+ * OpenBills - Self hosted browser app to generate and keep track of simple invoices
+ * Version - 0
+ * Licensed under the MIT license - https://opensource.org/licenses/MIT
+ *
+ * Copyright (c) 2021 Vidhu Kant Sharma
+*/
+
+import React, { Dispatch, SetStateAction, useState } from "react";
+import "./../Form.scss";
+import { Address } from "./../../../Interfaces/interfaces"
+
+interface Props {
+ heading: string
+ address: Address
+ setAddress: Dispatch<SetStateAction<Address>>
+}
+
+const NewAddressPane: React.FC<Props> = (props) => {
+ const address = props.address;
+
+return (
+ <div className={"widePane formPane"}>
+ <h3>{props.heading}</h3>
+
+ <label>
+ Address: <input className={"wideInputBox"}
+ type="text" value={address.AddressLine} onChange={
+ ({target: {value}}) => props.setAddress({...address, AddressLine: value})
+ }
+ required />
+ </label>
+
+ <label>
+ City: <input className={"wideInputBox"}
+ type="text" value={address.City} onChange={
+ ({target: {value}}) => props.setAddress({...address, City: value})
+ }
+ required />
+ </label>
+
+ <label>
+ State: <input className={"wideInputBox"}
+ type="text" value={address.State} onChange={
+ ({target: {value}}) => props.setAddress({...address, State: value})
+ }
+ required />
+ </label>
+
+ <label>
+ PIN Code: <input className={"wideInputBox"}
+ type="text" value={address.PINCode} onChange={
+ ({target: {value}}) => props.setAddress({...address, PINCode: value})
+ }
+ required />
+ </label>
+
+ <label>
+ Country: <input className={"wideInputBox"}
+ type="text" value={address.Country} onChange={
+ ({target: {value}}) => props.setAddress({...address, Country: value})
+ }
+ required />
+ </label>
+ </div>
+ );
+}
+
+export default NewAddressPane;