MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / pickPreset

Function pickPreset

ui-tui/src/components/billingOverlay.tsx:251–263  ·  view source on GitHub ↗
(i: number)

Source from the content-addressed store, hash-verified

249 }
250
251 const pickPreset = (i: number) => {
252 // Prefer the raw (numeric) preset for the amount; fall back to stripping $.
253 const raw = (rawPresets[i] ?? presets[i] ?? '').replace(/^\$/, '').trim()
254 const v = ctx.validate(raw)
255
256 if (v.error || !v.amount) {
257 setError(v.error ?? 'Invalid preset.')
258
259 return
260 }
261
262 toConfirm(v.amount)
263 }
264
265 const submitCustom = (raw: string) => {
266 const v = ctx.validate(raw)

Callers 1

chooseFunction · 0.85

Calls 2

toConfirmFunction · 0.85
validateMethod · 0.80

Tested by

no test coverage detected