(t0)
| 492 | return t7; |
| 493 | } |
| 494 | function TurnDurationMessage(t0) { |
| 495 | const $ = _c(17); |
| 496 | const { |
| 497 | message, |
| 498 | addMargin |
| 499 | } = t0; |
| 500 | const bg = useSelectedMessageBg(); |
| 501 | const [verb] = useState(_temp4); |
| 502 | const store = useAppStateStore(); |
| 503 | let t1; |
| 504 | if ($[0] !== store) { |
| 505 | t1 = () => { |
| 506 | const tasks = store.getState().tasks; |
| 507 | const running = (Object.values(tasks ?? {}) as TaskState[]).filter(isBackgroundTask); |
| 508 | return running.length > 0 ? getPillLabel(running) : null; |
| 509 | }; |
| 510 | $[0] = store; |
| 511 | $[1] = t1; |
| 512 | } else { |
| 513 | t1 = $[1]; |
| 514 | } |
| 515 | const [backgroundTaskSummary] = useState(t1); |
| 516 | let t2; |
| 517 | if ($[2] === Symbol.for("react.memo_cache_sentinel")) { |
| 518 | t2 = getGlobalConfig().showTurnDuration ?? true; |
| 519 | $[2] = t2; |
| 520 | } else { |
| 521 | t2 = $[2]; |
| 522 | } |
| 523 | const showTurnDuration = t2; |
| 524 | let t3; |
| 525 | if ($[3] !== message.durationMs) { |
| 526 | t3 = formatDuration(message.durationMs); |
| 527 | $[3] = message.durationMs; |
| 528 | $[4] = t3; |
| 529 | } else { |
| 530 | t3 = $[4]; |
| 531 | } |
| 532 | const duration = t3; |
| 533 | const hasBudget = message.budgetLimit !== undefined; |
| 534 | let t4; |
| 535 | bb0: { |
| 536 | if (!hasBudget) { |
| 537 | t4 = ""; |
| 538 | break bb0; |
| 539 | } |
| 540 | const tokens = message.budgetTokens; |
| 541 | const limit = message.budgetLimit; |
| 542 | let t5; |
| 543 | if ($[5] !== limit || $[6] !== tokens) { |
| 544 | t5 = tokens >= limit ? `${formatNumber(tokens)} used (${formatNumber(limit)} min ${figures.tick})` : `${formatNumber(tokens)} / ${formatNumber(limit)} (${Math.round(tokens / limit * 100)}%)`; |
| 545 | $[5] = limit; |
| 546 | $[6] = tokens; |
| 547 | $[7] = t5; |
| 548 | } else { |
| 549 | t5 = $[7]; |
| 550 | } |
| 551 | const usage = t5; |
nothing calls this directly
no test coverage detected