Add function to display incident's in list form from Firestore Database

This commit is contained in:
Ray 2023-12-28 14:16:40 +00:00 committed by GitHub
parent aca7a21f37
commit c77da414f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -46,7 +46,7 @@ export function MyForm(props) {
};
// Create a function to handle the form submission and add data to Firebase.
// Create a function to handle the form submission and add data to Firebase. NOT WORKING
const submitHandler = async (event) => {
event.preventDefault()
@ -143,7 +143,16 @@ export function MyForm(props) {
<Form.Group>
<Form.Label style={{ fontSize: '30px' }}>Existing entries</Form.Label>
<p>Check here for existing entries:</p>
<p>UNDER CONSTRUCTION:</p>
<p>Code added, work in progress to add said incidents to Firestore.</p>
<h2>Incidents in the Database:</h2>
{incidents.map((incident) => (
<div key={incident.id}>
<p>Submitter: {incident.submitter}</p>
<p>Date: {incident.date}</p>
<p>Context: {incident.context}</p>
<p>Selected Options: {incident.selectedOptions.join(", ")}</p>
</div>
))}
</Form.Group>
</Form>
</div>