-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redirect first responders to a patient not found page
- Loading branch information
Showing
2 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Container } from '@mantine/core'; | ||
import { useNavigate, useLocation } from 'react-router-dom'; | ||
import { useEffect } from 'react'; | ||
|
||
/** | ||
* Patient not found page component | ||
* | ||
*/ | ||
export default function PatientNotFound() { | ||
const navigate = useNavigate(); | ||
const location = useLocation(); | ||
|
||
useEffect(() => { | ||
if (!location.state?.fromRedirect) { | ||
navigate('/', { replace: true }); | ||
} | ||
}, [navigate, location]); | ||
|
||
return ( | ||
<Container> | ||
<h1>Patient Does Not Exist</h1> | ||
<p> The patient you are looking for does not exist yet.</p> | ||
</Container> | ||
); | ||
} |