I have a MUI AppBar and a Drawer in my layout.tsx. There are various Links within the Drawer. Each link should be shown, or not, based on the user roles.
The user roles are stored within my Firestore DB. I have access to the Firebase User, but the roles are not on that entity, they are stored by ID within my Firestore.
So, I need to be able to take my Firebase user, look up my Firestore user roles, and then filter the Links in the Drawer based on those roles.
This would all be really easy if I could use useEffect hook within the layout.tsx file, but that is not allowed. Interestingly useState hook seems to work just fine within the layout.tsx (I've set 'use client' on it).
How are others making state information available, and async updated states bound to items within layout.tsx?