Line

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

ui/client/features/tests/hooks/useCopyText

Cockpit client (features), next. Source: ui/client/features/tests/hooks/useCopyText.tsx.

Functions#

useCopyText()#

useCopyText(scope): object

Defined in: ui/client/features/tests/hooks/useCopyText.tsx:7

Copy text for a ticket. copied is the key of what was last copied; when the browser will not let a page write the clipboard, copy says so (false) and the caller leaves the text on screen to select. Reset whenever scope changes.

Parameters#

scope

string

Returns#

object

copied

copied: string | null

copy

copy: (key, text) => Promise<boolean>

Parameters
key

string

text

string

Returns

Promise<boolean>