The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { useGT } from "gt-react-native"; |
| 2 | import { |
| 3 | MAX_SIDEBAR_AUTO_SETTLE_AFTER_DAYS, |
| 4 | MIN_SIDEBAR_AUTO_SETTLE_AFTER_DAYS, |
| 5 | } from "@t3tools/contracts"; |
| 6 | import type { ComponentProps } from "react"; |
| 7 | import { NumberField } from "../../../components/ui/NumberField"; |
| 8 | |
| 9 | export type AutoSettleDaysFieldProps = Pick< |
| 10 | ComponentProps<typeof NumberField>, |
| 11 | "value" | "onValueChange" | "disabled" |
| 12 | >; |
| 13 | |
| 14 | export function AutoSettleDaysField(props: AutoSettleDaysFieldProps) { |
| 15 | const gt = useGT(); |
| 16 | return ( |
| 17 | <NumberField |
| 18 | {...props} |
| 19 | min={MIN_SIDEBAR_AUTO_SETTLE_AFTER_DAYS} |
| 20 | max={MAX_SIDEBAR_AUTO_SETTLE_AFTER_DAYS} |
| 21 | label={gt("Days before auto-settle")} |
| 22 | formatValue={(value) => |
| 23 | gt("{count, plural, one {{count} day} other {{count} days}}", { count: value }) |
| 24 | } |
| 25 | /> |
| 26 | ); |
| 27 | } |