Working tree is now the canonical repo. Off-chain play-money + trustless on-chain (FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution, mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
61 lines
1.5 KiB
TypeScript
61 lines
1.5 KiB
TypeScript
import clsx from 'clsx'
|
|
import { Col } from '../layout/col'
|
|
import { TokenNumber } from '../widgets/token-number'
|
|
import { PortfolioMode } from './portfolio-graph'
|
|
|
|
export const PortfolioGraphNumber = (props: {
|
|
numberType: 'balance' | 'investment' | 'spice' | 'profit'
|
|
descriptor: string
|
|
portfolioFocus: PortfolioMode
|
|
displayedAmount: number | undefined
|
|
onClick: () => void
|
|
className?: string
|
|
numberClassName?: string
|
|
isSpice?: boolean
|
|
prefersPlay?: boolean
|
|
}) => {
|
|
const {
|
|
portfolioFocus,
|
|
numberType,
|
|
descriptor,
|
|
displayedAmount,
|
|
onClick,
|
|
className,
|
|
numberClassName,
|
|
isSpice,
|
|
prefersPlay,
|
|
} = props
|
|
|
|
return (
|
|
<div
|
|
className={clsx(
|
|
'group cursor-pointer select-none rounded px-2 py-1 transition-colors',
|
|
portfolioFocus !== 'all' && portfolioFocus !== numberType
|
|
? 'opacity-50 hover:opacity-[0.75]'
|
|
: portfolioFocus == numberType
|
|
? 'opacity-100'
|
|
: 'opacity-[0.75] hover:opacity-100',
|
|
className
|
|
)}
|
|
onClick={onClick}
|
|
>
|
|
<Col>
|
|
<TokenNumber
|
|
amount={displayedAmount}
|
|
className={clsx('font-bold transition-all', className, numberClassName)}
|
|
coinType={isSpice ? 'spice' : prefersPlay ? 'mana' : 'sweepies'}
|
|
/>
|
|
|
|
<div
|
|
className={clsx(
|
|
portfolioFocus == numberType ? 'text-white/80' : 'text-ink-600',
|
|
' mx-auto -mt-1 text-xs transition-all'
|
|
)}
|
|
>
|
|
{descriptor}
|
|
</div>
|
|
</Col>
|
|
</div>
|
|
)
|
|
}
|