Line

ui/client/features/pages-editor/hooks/usePropRow

Cockpit client (features), v0.9. Source: ui/client/features/pages-editor/hooks/usePropRow.tsx.

Functions#

usePropRow()#

usePropRow(feature, file, nodeId, contentHash, prop, onSaved): object

Defined in: ui/client/features/pages-editor/hooks/usePropRow.tsx:18

One prop's edit/save state. kind here is the widget kind (string/number/boolean/expression) used to pick the right input control — #77 follow-up: label/isSpread are derived here (not in the component — COMPONENT-003 bans a component importing domain directly) so a spread prop ({...rest}, no attribute name) displays via propLabel instead of a null name. On save, a spread sends its real 'spread' kind (not the collapsed 'expression' widget kind) plus index (its position in the attribute list) instead of a name, since buildAttributeSnippet's spread branch renders {...expr} rather than name={expr} and has no name to look it up by.

Parameters#

feature

string

file

string

nodeId

string

contentHash

string

prop

PropData

onSaved

(tree) => void

Returns#

object

busy

busy: boolean

isSpread

isSpread: boolean

kind

kind: "string" | "number" | "boolean" | "expression"

label

label: string | null

save

save: () => Promise<void>

Returns

Promise<void>

setValue

setValue: Dispatch<unknown>

status

status: StatusMessage | null

value

value: unknown