Moved dashboard state to a reducer to lower file complexity
Removed useMemo and useState from dashboard.js. Created a reducer to handle the state for the dashboard.
Also added a useIsMounted hook for use in async useEffects. Use it to verify the component is mounted when trying to update state.