diff options
Diffstat (limited to 'src/components/Form/Document/DocumentInfoForm.tsx')
-rw-r--r-- | src/components/Form/Document/DocumentInfoForm.tsx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/components/Form/Document/DocumentInfoForm.tsx b/src/components/Form/Document/DocumentInfoForm.tsx index 6193233..18d0be5 100644 --- a/src/components/Form/Document/DocumentInfoForm.tsx +++ b/src/components/Form/Document/DocumentInfoForm.tsx @@ -8,10 +8,13 @@ import React, { useState } from "react"; import { Person } from "./../../../interfaces"; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { faSync } from '@fortawesome/free-solid-svg-icons' import "./../Form.scss"; import SelectClientForm from "./../People/SelectClientForm"; + interface Props { savedPeople: Person[] invoiceNumber: number @@ -29,9 +32,19 @@ const DocumentInfoForm: React.FC<Props> = (props) => { <div className={"documentInfoChild"}> <label> Invoice Number: - <input className={"smallInputBox"} type="number" step="0.0" value={invoiceNumber} onInput={ - (event: React.FormEvent<HTMLInputElement>) => setInvoiceNumber(parseInt(event.currentTarget.value)) - } required /> + <span className={"buttonInput"}> + {invoiceNumber === props.invoiceNumber || + <FontAwesomeIcon icon={faSync} className={"icon"} onClick={ + (event) => { + event.preventDefault(); // don't select the input box + setInvoiceNumber(props.invoiceNumber); + } + }/> + } + <input className={"smallInputBox"} type="number" step="0.0" value={invoiceNumber} + onInput={(event: React.FormEvent<HTMLInputElement>) => setInvoiceNumber(parseInt(event.currentTarget.value))} + required /> + </span> </label> <label> |