Some checks failed
Deploy Explorer Live / deploy (push) Failing after 13s
- Mirror token-aggregation liquidity scaling in tokenAggregation API layer - Tokens page and shared brand/layout tweaks - deploy-live workflow adjustment Co-authored-by: Cursor <cursoragent@cursor.com>
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import { formatRelativeAge, formatTimestamp } from '@/utils/format'
|
|
|
|
function formatSource(source?: string | null): string {
|
|
switch (source) {
|
|
case 'token-aggregation':
|
|
return 'token aggregation API'
|
|
case 'blockscout':
|
|
return 'Blockscout index'
|
|
case 'derived':
|
|
return 'derived from indexed supply and price inputs'
|
|
case 'mission-control':
|
|
return 'mission-control liquidity inventory'
|
|
default:
|
|
return source || 'source unavailable'
|
|
}
|
|
}
|
|
|
|
export default function MarketEvidenceNote({
|
|
source = 'token-aggregation',
|
|
lastUpdated,
|
|
method = 'DEX route and pool aggregation; visible liquidity only where indexed.',
|
|
compact = false,
|
|
}: {
|
|
source?: string | null
|
|
lastUpdated?: string | null
|
|
method?: string
|
|
compact?: boolean
|
|
}) {
|
|
const freshness = lastUpdated ? `${formatRelativeAge(lastUpdated)} (${formatTimestamp(lastUpdated)})` : 'timestamp unavailable'
|
|
const text = compact
|
|
? `Updated ${freshness} · ${formatSource(source)}`
|
|
: `Source: ${formatSource(source)}. Updated: ${freshness}. Method: ${method}`
|
|
|
|
return (
|
|
<p className={`${compact ? 'mt-1' : 'mt-3'} text-xs leading-5 text-gray-500 dark:text-gray-400`}>
|
|
{text}
|
|
</p>
|
|
)
|
|
}
|