import { useSelector } from "react-redux"; import LoadingSpinner from "../Spinners/LoadingSpinner"; import WalletItemCard from "./WalletItemCard"; import WalletItemCardFamily from "./WalletItemCardFamily"; /** * Renders a list of wallet items or a loading spinner depending on the state of the `wallet` object. */ export default function WalletBox({ wallet, payment, countries }) { const { loading, data } = wallet; const { userDetails } = useSelector((state) => state.userDetails); const accountType = userDetails?.account_type === "FAMILY"; return (
{loading ? (
) : ( data.length > 0 && data.map((item) => (
)) )}
); }