ui/client/features/component-docs/hooks/useComponentEditor
Cockpit client (features), v0.9. Source: ui/client/features/component-docs/hooks/useComponentEditor.tsx.
Functions#
useComponentEditor()#
useComponentEditor(
path,onSaved):object
Defined in: ui/client/features/component-docs/hooks/useComponentEditor.tsx:14
The plain-file editor of one component: load its text, edit it, review the diff, confirm the save. All writes go
through the server's reviewed path (preview, then hash-checked + architecture-gated commit). onSaved lets the
screen refresh what depends on the file (its props).
Parameters#
path
string | null
onSaved
() => void
Returns#
object
cancelReview
cancelReview: () =>
void
Returns
void
confirm
confirm: () =>
Promise<void>
Returns
Promise<void>
diagnostics
diagnostics:
SourceDiagnostic[]
dirty
dirty:
boolean
discard
discard: () =>
void
Returns
void
edit
edit: (
draft) =>void
Parameters
draft
string
Returns
void
loadError
loadError:
string|null
loading
loading:
boolean
reload
reload: () => () =>
void=load
Returns
() => void
review
review: () =>
Promise<void>
Returns
Promise<void>
state
state:
EditState