Component
UnitDiplomacy
Choose a unit policy and the submitted value is actually recalculated into that representation. Minutes, hours and workdays produce different numbers and suffixes, while End negotiations returns to the unrepresented value.
Possible use
It could let a reviewer decide whether a handoff estimate should sound immediate, calm or bureaucratic, or let a presenter make an agenda duration negotiate with the calendar. The value is already measurable before its diplomatic hearing.
Reasonable alternative
A reasonable local alternative is formatting the duration once at its display boundary and preserving the source unit. Three buttons should not decide how urgent a number feels.
01 / Preview
Try it yourself.
One value, three official reports90Choose a unit to begin negotiations.
Mechanism
- 1
- Begin with one duration reported as 90 minutes.
- 2
- Choose minutes, hours or workdays as the official unit.
- 3
- Each ruling recalculates the actual number and its suffix.
- 4
- End negotiations when the value wants to be unrepresented again.
02 / Usage
Put it somewhere.
example.tsxTSX
import { UnitDiplomacy } from "gra-ui";
import "gra-ui/styles.css";
export function NegotiatedDuration() {
return <UnitDiplomacy value={90} />;
}03 / API
Small surface area.
PropTypeDescription
valuenumberThe duration, submitted in minutes, that must choose a reporting unit.