Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/client/features/generate-control/hooks/useGenerateMode

Cockpit client (features), next. Source: ui/client/features/generate-control/hooks/useGenerateMode.tsx.

Functions#

useGenerateMode()#

useGenerateMode(actionKind): object

Defined in: ui/client/features/generate-control/hooks/useGenerateMode.tsx:12

Owns the remembered Mechanical/AI choice for one action kind, plus whether the local model is currently reachable (docs/design/ia-five-screens.md section 8.6: "reset to Mechanical when the model is offline"). One instance per action kind; several actions of the same kind on screen share the choice by using the same actionKind.

Parameters#

actionKind

string

Returns#

object

chooseMode

chooseMode: (next) => void

Parameters
next

GenerateMode

Returns

void

mode

mode: GenerateMode

modelOffline

modelOffline: boolean