Files
explorer-monorepo/frontend/src/components/common/PostureBadge.tsx
defiQUG 763ca75c21
Some checks failed
Deploy Explorer Live / deploy (push) Failing after 13s
Validate Explorer / frontend (push) Failing after 18s
Validate Explorer / smoke-e2e (push) Has been skipped
Ship Tier A Week 1–2: posture glossary, delivery mode, freshness UI, canonical tokens.
Expose mission-control mode on home/bridge/analytics, quiet-chain freshness copy, and a canonical-first indexed token list with WETH9 metadata override and non-canonical warnings.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-23 03:48:22 -07:00

34 lines
895 B
TypeScript

'use client'
import EntityBadge from '@/components/common/EntityBadge'
import { usePostureGlossary } from '@/components/common/PostureGlossaryProvider'
import { resolvePostureTermId } from '@/data/postureGlossary'
export default function PostureBadge({
label,
tone,
className,
}: {
label: string
tone?: 'neutral' | 'success' | 'warning' | 'info'
className?: string
}) {
const { openTerm } = usePostureGlossary()
const termId = resolvePostureTermId(label)
if (!termId) {
return <EntityBadge label={label} tone={tone} className={className} />
}
return (
<button
type="button"
onClick={() => openTerm(termId)}
title="Open posture glossary"
className="rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500"
>
<EntityBadge label={label} tone={tone} className={className} />
</button>
)
}