MCPcopy Create free account
hub / github.com/AmazingAng/PolyWorld / PositionRow

Function PositionRow

src/components/TraderPanel.tsx:188–207  ·  view source on GitHub ↗
({ position: p, dimmed }: { position: TraderPosition; dimmed?: boolean })

Source from the content-addressed store, hash-verified

186}
187
188function PositionRow({ position: p, dimmed }: { position: TraderPosition; dimmed?: boolean }) {
189 return (
190 <div
191 className="smart-money-row px-2 py-1 flex items-center gap-2 tabular-nums"
192 style={{ opacity: dimmed ? 0.5 : 1 }}
193 >
194 <div className="flex-1 min-w-0 truncate text-[var(--text)]" title={p.title}>
195 {p.title || truncAddr(p.conditionId)}
196 </div>
197 <span className="text-[var(--text-dim)] w-[28px] text-right shrink-0">{p.outcome}</span>
198 <span className="text-[var(--text)] w-[48px] text-right shrink-0">{formatVolume(p.currentValue)}</span>
199 <span
200 className="w-[52px] text-right shrink-0"
201 style={{ color: p.cashPnl >= 0 ? "#22c55e" : "#ff4444" }}
202 >
203 {p.cashPnl >= 0 ? "+" : ""}{formatVolume(p.cashPnl)}
204 </span>
205 </div>
206 );
207}
208
209function ActivityRow({ activity: a }: { activity: TraderActivity }) {
210 const typeBadgeColors: Record<string, string> = {

Callers

nothing calls this directly

Calls 2

formatVolumeFunction · 0.90
truncAddrFunction · 0.70

Tested by

no test coverage detected