import getAccount from "@hey/helpers/getAccount"; import type { AccountFragment } from "@hey/indexer"; import type { ReactNode } from "react"; import { memo } from "react"; import AccountLink from "@/components/Shared/Account/AccountLink"; import cn from "@/helpers/cn"; import Slug from "./Slug"; interface FallbackAccountNameProps { className?: string; account?: AccountFragment; separator?: ReactNode; } const FallbackAccountName = ({ className = "", account, separator = "" }: FallbackAccountNameProps) => { if (!account) { return null; } const { name, username } = getAccount(account); const accountName = account?.metadata?.name || ; return ( <> {accountName} {separator && {separator}} ); }; export default memo(FallbackAccountName);