PositionChangeDialog
Modal that moves a miner to a different rack slot, validating the destination first.
Modal that moves a miner to a different rack slot, validating the destination first.
import { PositionChangeDialog } from "@tetherto/mdk-react-devkit";| Prop | Status | Type | Default | Description |
|---|---|---|---|---|
open | Required | boolean | — | — |
onClose | Required | (currentDialogFlow: string, isDontReset?: boolean | undefined) => void | — | — |
selectedSocketToReplace | Optional | UnknownRecord | undefined | — | — |
selectedEditSocket | Optional | UnknownRecord | undefined | — | — |
onChangePositionClicked | Optional | VoidFunction | undefined | — | — |
onPositionChangedSuccess | Optional | VoidFunction | undefined | — | — |
isContainerEmpty | Optional | boolean | undefined | — | — |
dialogFlow | Optional | string | undefined | — | — |
Usage
Multi-step dialog flow for moving a miner between rack slots or performing maintenance. Composed of a top-level orchestrator and three swappable content panels.
| Component | Description |
|---|---|
PositionChangeDialog | Top-level multi-step dialog orchestrating the slot-change flow. |
ContainerSelectionDialog | Step for picking a target container. |
RemoveMinerDialog | Confirmation step for removing a miner from its current slot. |
MaintenanceDialogContent | Form for capturing work-order details before applying the maintenance flag. |
PositionChangeDialog Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
open | boolean | yes | — | Controls dialog visibility. |
onClose | (flow, isDontReset?) => void | yes | — | Called when dialog closes. |
selectedSocketToReplace | UnknownRecord | no | — | Socket being replaced. |
selectedEditSocket | UnknownRecord | no | — | Socket being edited. |
onChangePositionClicked | VoidFunction | no | — | Callback when position change is triggered. |
onPositionChangedSuccess | VoidFunction | no | — | Callback on successful position change. |
isContainerEmpty | boolean | no | — | Whether the target container slot is empty. |
dialogFlow | string | no | — | Initial dialog step/flow identifier. |
Minimal example
import { PositionChangeDialog } from "@tetherto/mdk-react-devkit";
<PositionChangeDialog
open={isOpen}
onClose={(flow) => setIsOpen(false)}
/>
Example
import { useState } from 'react'import { PositionChangeDialog } from '@tetherto/mdk-react-devkit'export const PositionChangeDialogExample = () => { const [open, setOpen] = useState(false) return ( <div className="mdk-example-row"> <button onClick={() => setOpen(true)}>Open Position-Change Dialog</button> <PositionChangeDialog open={open} onClose={() => setOpen(false)} /> </div> )}