Skip to content

feat: use typed anchor status mapping in UI badge component - #106

Merged
El-swaggerito merged 1 commit into
Axionvera:mainfrom
norbert351:feat/anchor-status-ui-mapping-36
Jul 28, 2026
Merged

feat: use typed anchor status mapping in UI badge component#106
El-swaggerito merged 1 commit into
Axionvera:mainfrom
norbert351:feat/anchor-status-ui-mapping-36

Conversation

@norbert351

Copy link
Copy Markdown
Contributor

Description

Replaces the hardcoded duplicate label and style maps in AnchorStatusBadge with the shared anchorStatusBadge() function from @anchorkit/anchor-utils.

Before

The AnchorStatusBadge component in apps/web/components/ui.tsx had its own hardcoded label and styles maps — duplicating the source of truth in the package.

After

The component delegates to the typed anchorStatusBadge(status) mapping which returns { label, tone }. The tone (neutral/amber/blue/green/red) is then mapped through a local tone→style dictionary for Tailwind classes.

Why

  • Single source of truth — the package defines status labels and semantics
  • If a new status is added to the AnchorTransactionStatus type, the badge automatically gets the correct label via TypeScript exhaustiveness
  • No more out-of-sync duplicate maps between the UI and the package

Closes #36

Replace the hardcoded duplicate label/style maps in AnchorStatusBadge
with the shared anchorStatusBadge() from @anchorkit/anchor-utils.
Use the badge tone (neutral/amber/blue/green/red) as the single
source of truth for styling, mapped through a local tone→style
dictionary.

Closes Axionvera#36
@El-swaggerito
El-swaggerito merged commit aa56862 into Axionvera:main Jul 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement typed anchor status to UI message mapping

2 participants