MDK Logo
UI Kitreact-devkitComponentsFoundationWidgets

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";
PropStatusTypeDefaultDescription
openRequiredboolean
onCloseRequired(currentDialogFlow: string, isDontReset?: boolean | undefined) => void
selectedSocketToReplaceOptionalUnknownRecord | undefined
selectedEditSocketOptionalUnknownRecord | undefined
onChangePositionClickedOptionalVoidFunction | undefined
onPositionChangedSuccessOptionalVoidFunction | undefined
isContainerEmptyOptionalboolean | undefined
dialogFlowOptionalstring | 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.

ComponentDescription
PositionChangeDialogTop-level multi-step dialog orchestrating the slot-change flow.
ContainerSelectionDialogStep for picking a target container.
RemoveMinerDialogConfirmation step for removing a miner from its current slot.
MaintenanceDialogContentForm for capturing work-order details before applying the maintenance flag.

PositionChangeDialog Props

PropTypeRequiredDefaultDescription
openbooleanyesControls dialog visibility.
onClose(flow, isDontReset?) => voidyesCalled when dialog closes.
selectedSocketToReplaceUnknownRecordnoSocket being replaced.
selectedEditSocketUnknownRecordnoSocket being edited.
onChangePositionClickedVoidFunctionnoCallback when position change is triggered.
onPositionChangedSuccessVoidFunctionnoCallback on successful position change.
isContainerEmptybooleannoWhether the target container slot is empty.
dialogFlowstringnoInitial 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>  )}