Line

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

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

Functions#

usePalette()#

usePalette(feature): object

Defined in: ui/client/features/pages-editor/hooks/usePalette.tsx:12

The open page's feature's Palette: refetches only when the feature itself changes, not on every node/file selection -- Providers/Expressions/Components are the same for every page of a feature (see block-palette.md section 2). refetch lets a caller ask for a fresh read after something OTHER than a feature change adds a unit the list should now show -- a confirmed "Wrap with..." creates a brand-new Expression this same list needs to include next render.

Parameters#

feature

string

Returns#

object

data

data: PaletteData | null

error

error: string | null

loading

loading: boolean

refetch

refetch: () => void

Returns

void