@babylonlabs-io/core-ui 1.14.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,6 +13,11 @@ export interface FinalityProviderItemProps {
13
13
  address?: string;
14
14
  provider: Provider;
15
15
  onRemove?: (id?: string) => void;
16
+ /**
17
+ * Controls whether the chain-related information (e.g., address or BSN name/logo) is displayed.
18
+ * Defaults to `true`.
19
+ */
20
+ showChain?: boolean;
16
21
  }
17
- export declare function FinalityProviderItem({ bsnId, bsnName, bsnLogoUrl, address, provider, onRemove }: FinalityProviderItemProps): import("react/jsx-runtime").JSX.Element | null;
22
+ export declare function FinalityProviderItem({ bsnId, bsnName, bsnLogoUrl, address, provider, onRemove, showChain }: FinalityProviderItemProps): import("react/jsx-runtime").JSX.Element | null;
18
23
  export {};
@@ -3,7 +3,7 @@ import { Avatar } from "../../components/Avatar";
3
3
  import { Text } from "../../components/Text";
4
4
  import { CloseIcon } from "../../components/Icons";
5
5
  import { FinalityProviderLogo } from "../FinalityProviderLogo/FinalityProviderLogo";
6
- export function FinalityProviderItem({ bsnId, bsnName, bsnLogoUrl, address, provider, onRemove }) {
6
+ export function FinalityProviderItem({ bsnId, bsnName, bsnLogoUrl, address, provider, onRemove, showChain = true }) {
7
7
  if (!provider)
8
8
  return null;
9
9
  const renderBsnLogo = () => {
@@ -20,6 +20,8 @@ export function FinalityProviderItem({ bsnId, bsnName, bsnLogoUrl, address, prov
20
20
  return `${value.slice(0, visibleChars)}...${value.slice(-visibleChars)}`;
21
21
  };
22
22
  const renderChainOrAddress = () => {
23
+ if (!showChain)
24
+ return null;
23
25
  if (address) {
24
26
  return (_jsx("div", { className: "text-xs text-accent-secondary", children: shortenAddress(address) }));
25
27
  }
@@ -15,6 +15,8 @@ export interface ProviderItem {
15
15
  interface ProvidersListProps {
16
16
  items: ProviderItem[];
17
17
  onRemove: (id?: string) => void;
18
+ /** Whether to display the chain (BSN) info for each provider. Defaults to true. */
19
+ showChain?: boolean;
18
20
  }
19
- export declare function ProvidersList({ items, onRemove }: ProvidersListProps): import("react/jsx-runtime").JSX.Element | null;
21
+ export declare function ProvidersList({ items, onRemove, showChain }: ProvidersListProps): import("react/jsx-runtime").JSX.Element | null;
20
22
  export {};
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
3
  import { FinalityProviderItem } from "../FinalityProviderItem/FinalityProviderItem";
4
- export function ProvidersList({ items, onRemove }) {
4
+ export function ProvidersList({ items, onRemove, showChain = true }) {
5
5
  const values = useMemo(() => items, [items]);
6
6
  if (values.length === 0)
7
7
  return null;
8
- return (_jsx("div", { className: "flex flex-col gap-8", children: values.map(({ bsnId, bsnName, bsnLogoUrl, provider }) => (_jsx(FinalityProviderItem, { bsnId: bsnId, bsnName: bsnName, bsnLogoUrl: bsnLogoUrl, provider: provider, onRemove: onRemove }, `${bsnId}-${provider.rank}`))) }));
8
+ return (_jsx("div", { className: "flex flex-col gap-8", children: values.map(({ bsnId, bsnName, bsnLogoUrl, provider }) => (_jsx(FinalityProviderItem, { bsnId: bsnId, bsnName: bsnName, bsnLogoUrl: bsnLogoUrl, provider: provider, onRemove: onRemove, showChain: showChain }, `${bsnId}-${provider.rank}`))) }));
9
9
  }