import { accountDisplayParts, accountIdentityParts } from "./account-display.js";

export function AccountIdentity({ account, accounts = [], identity, mosaic = false }) {
  const parts = identity === undefined ? accountDisplayParts(account, accounts) : accountIdentityParts(identity);
  const value = `${parts.local}${parts.domain}`;
  if (!mosaic) return value;
  return <><span className="account-identity-local account-identity-local--mosaic">{parts.local}<span className="account-identity-mosaic-overlay" aria-hidden="true"></span></span>{parts.domain}</>;
}
