import { useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { fetchAdminUser } from '../../redux/features/adminSlice'; const AdminDetails = () => { const dispatch = useDispatch(); const { adminuser, loading, error } = useSelector((state) => state.admin); console.log("adminuser", adminuser) useEffect(() => { dispatch(fetchAdminUser()); }, [dispatch]); if (loading) return
Loading...
; if (error) returnError: {error}
; return (Username: {adminuser.username}
{/* Add other fields here if available in the response */}No admin user details found. Thank you
)}