Skip to content

frontend-web-editor


Function: UseFaultTreeContextMenuClick()

UseFaultTreeContextMenuClick(id): object

Defined in: app/hooks/faultTree/useFaultTreeContextMenuClick.ts:43

Hook for handling context menu click event.

This hook provides a function handleContextMenuClick that can be used to update the state of the fault tree based on the selected node type. It utilizes the React Flow library for managing nodes and edges in a flowchart-like UI.

Parameters

id

string

The unique identifier for each node.

Returns

object

handleContextMenuClick()

handleContextMenuClick: (updateNodeType) => Promise<void>

Parameters

updateNodeType

string

Returns

Promise<void>

validateFaultTreeContextMenuClick()

validateFaultTreeContextMenuClick: (id, type) => string

Parameters

id

string

type

string

Returns

string

Example

typescript
const { handleContextMenuClick } = useFaultTreeContextMenuClick('uniqueNodeId');