import getAccount from "@hey/helpers/getAccount"; import type { AccountFragment } from "@hey/indexer"; import type { ComponentProps, ReactNode } from "react"; import { Link } from "react-router"; import { useAccountLinkStore } from "@/store/non-persisted/navigation/useAccountLinkStore"; interface AccountLinkProps extends Omit, "to"> { account: AccountFragment; children: ReactNode; } const AccountLink = ({ account, children, onClick, ...props }: AccountLinkProps) => { const { setCachedAccount } = useAccountLinkStore(); const { link } = getAccount(account); return ( { setCachedAccount(account); onClick?.(e); }} > {children} ); }; export default AccountLink;