**Description:** Show or hide UI elements based on the user's role (`user` or `admin`). **Tasks:** - [ ] Create a `src/hooks/useRole.js` custom hook that returns `{ isAdmin, isUser }` based on `selectCurrentUser` - [ ] Hide the "Create Campaign" button for admin users - [ ] Show the "Admin Panel" link in the Navbar only for admin users - [ ] Conditionally render "Edit" and "Delete" buttons on campaign cards only for the campaign owner - [ ] Create a `<AdminRoute>` component that redirects non-admins to `/dashboard` **Acceptance Criteria:** Admin-only UI is hidden from regular users; owner-only actions are hidden from non-owners.
Description:
Show or hide UI elements based on the user's role (
useroradmin).Tasks:
src/hooks/useRole.jscustom hook that returns{ isAdmin, isUser }based onselectCurrentUser<AdminRoute>component that redirects non-admins to/dashboardAcceptance Criteria:
Admin-only UI is hidden from regular users; owner-only actions are hidden from non-owners.