mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-23 14:06:19 +01:00
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import { fmtDuration } from '../format'
|
|
import type { BudgetRules } from '../types'
|
|
|
|
interface Props {
|
|
rules: BudgetRules
|
|
}
|
|
|
|
function onOff(value: boolean): string {
|
|
return value ? 'on' : 'off'
|
|
}
|
|
|
|
export function BudgetRulesCard({ rules }: Props) {
|
|
return (
|
|
<section className="budget-rules">
|
|
<h2>Rules in effect</h2>
|
|
<dl className="budget-rules-list">
|
|
<dt>Daily budget</dt>
|
|
<dd>{fmtDuration(rules.budget_seconds)}</dd>
|
|
{rules.carry_seconds > 0 && (
|
|
<>
|
|
<dt>Carried over</dt>
|
|
<dd>+{fmtDuration(rules.carry_seconds)} unspent from earlier free days</dd>
|
|
</>
|
|
)}
|
|
<dt>Enforcement</dt>
|
|
<dd>{onOff(rules.enforcement)}</dd>
|
|
<dt>Counts launchers</dt>
|
|
<dd>{rules.counts_launchers ? 'yes' : 'no'}</dd>
|
|
<dt>Warnings at</dt>
|
|
<dd>{rules.warn_at.map((s) => fmtDuration(s)).join(', ')} remaining</dd>
|
|
{rules.demo && (
|
|
<>
|
|
<dt>Mode</dt>
|
|
<dd>demo (short budget, separate state)</dd>
|
|
</>
|
|
)}
|
|
{rules.masked_launchers.length > 0 && (
|
|
<>
|
|
<dt>Masked now</dt>
|
|
<dd>{rules.masked_launchers.join(', ')}</dd>
|
|
</>
|
|
)}
|
|
</dl>
|
|
</section>
|
|
)
|
|
}
|