MDK Logo
ReferenceUIComponents

Dialog Components

Modal dialogs, confirmation prompts, and dialog utilities

Modal and dialog components for user interactions.

Prerequisites

  • Complete the installation
  • Import styles: import '@tetherto/mdk-react-devkit/styles.css'

Components

AddSparePartModal

Modal for registering a new spare part. Presents a part-type tab strip and a form for miner model, part model, serial number, MAC address (controllers only), status, location, tags, and a comment. Va…

agent-ready

Props

PropTypeRequiredDefaultDescription
isOpenboolean--
onCloseVoidFunction--
partTypesSparePartSubTypesModalPartType[]--
defaultPartTypeIdstring | undefined--
modelOptionsFormSelectOption[]--
isModelOptionsLoadingboolean | undefined--
minerModelOptionsFormSelectOption[]--
statusOptionsFormSelectOption[]--
locationOptionsFormSelectOption[]--
isControllerPartTypeSelectedboolean | undefined--
onPartTypeChange(partTypeId: string) => void--
onSubmit(values: AddSparePartFormValues) => Promise<void | { fieldErrors?: { field: string; message: string; }[] | undefined; }>--
isLoadingboolean | undefined--
subTypesPartTypesSparePartSubTypesModalPartType[] | undefined--
subTypesActivePartTypeIdstring | undefined--
subTypesstring[] | undefined--
onSubTypesPartTypeChange((id: string) => void) | undefined--
onAddSubType((name: string) => Promise<void | { error?: string | undefined; }>) | undefined--
isSubTypesLoadingboolean | undefined--

AlertDialogAction

Primary confirmation button inside an &lt;AlertDialog&gt;; clicking dismisses the dialog and runs the action handler.

agent-ready

AlertDialogCancel

Secondary dismiss button inside an &lt;AlertDialog&gt;; closes the dialog without invoking the destructive action.

agent-ready

AlertDialogContent

Modal content surface for an &lt;AlertDialog&gt; — renders the centered panel above the overlay with focus trap.

agent-ready

AlertDialogDescription

Supporting body text inside an &lt;AlertDialog&gt;; conveys the consequences of the action being confirmed.

agent-ready

AlertDialogFooter

Right-aligned action row inside an &lt;AlertDialog&gt; — hosts the cancel and confirm buttons.

agent-ready

AlertDialogHeader

Top section of an &lt;AlertDialog&gt; that groups the title and description above the action row.

agent-ready

AlertDialogOverlay

Full-viewport scrim rendered behind an &lt;AlertDialog&gt; to block interaction with the page.

agent-ready

AlertDialogTitle

Prominent title text inside an &lt;AlertDialog&gt; summarising the action that requires confirmation.

agent-ready

AssignPoolModal

Modal dialog for bulk-assigning a set of selected miners to a pool config. Displays the miner list, a pool selector with metadata (unit/miner counts, last-updated time), an endpoints preview, and an…

agent-ready

Props

PropTypeRequiredDefaultDescription
isOpenboolean--
onClose() => void--
onSubmit(values: { pool: PoolSummary; }) => Promise<void>--
minersDevice[]--
poolConfigPoolConfigEntry[]--

BatchMoveSparePartsModal

Modal for moving multiple spare parts at once. Shows the selected parts in a table and lets the user choose a new location and/or status plus an observation, applied to every part. Receives the parts…

agent-ready

Props

PropTypeRequiredDefaultDescription
isOpenboolean--
onCloseVoidFunction--
sparePartsBatchMoveSparePart[]--
locationOptionsFormSelectOption[]--
statusOptionsFormSelectOption[]--
onSubmit(values: { location: string | null; status: string | null; observation: string | null; }) => void | Promise<void>--

BulkAddSparePartsModal

Modal for bulk-adding spare parts from a CSV file. Provides a CSV template download, file selection with client-side parsing, and submits the parsed records. Receives the submit handler as a prop; CS…

agent-ready

Props

PropTypeRequiredDefaultDescription
isOpenboolean--
onCloseVoidFunction--
onSubmit(records: CSVRecord[]) => Promise<void | { error?: string | undefined; }>--
isLoadingboolean | undefined--

ConfirmDeleteSparePartModal

Confirmation modal for deleting a spare part. Warns that the action is irreversible and surfaces the part code so the user can verify before confirming. Receives the part and confirm handler as props.

agent-ready

Props

PropTypeRequiredDefaultDescription
isOpenboolean | undefined--
onCloseVoidFunction | undefined--
onConfirm((sparePart: ConfirmDeleteSparePartModalSparePart) => void | Promise<void>) | undefined--
sparePartConfirmDeleteSparePartModalSparePart | undefined--
isLoadingboolean | undefined--

DialogContent

Centered modal surface for a &lt;Dialog&gt; — renders above the overlay with focus trap and Escape-to-close.

agent-ready

Props

PropTypeRequiredDefaultDescription
titlestring | undefined--
descriptionstring | undefined--
closeOnClickOutsideboolean | undefined--
closeOnEscapeboolean | undefined--
bareboolean | undefined--
closableboolean | undefined--
onCloseVoidFunction | undefined--

DialogDescription

Supporting body copy inside a &lt;Dialog&gt; rendered below the title.

agent-ready

DialogFooter

Action row at the bottom of a &lt;Dialog&gt; — typically primary/secondary buttons.

agent-ready

DialogHeader

Top region of a &lt;Dialog&gt; that groups the title and description.

agent-ready

Props

PropTypeRequiredDefaultDescription
bareboolean | undefined--
closableboolean | undefined--
onCloseVoidFunction | undefined--

DialogOverlay

Full-viewport scrim rendered behind an open &lt;Dialog&gt; to block background interaction.

agent-ready

DialogTitle

Prominent title text at the top of a &lt;Dialog&gt; summarising the modal's purpose.

agent-ready

MovementDetailsModal

Modal showing the details of a historical device movement — the device summary plus the origin → destination transition of location and status. Receives the selected movement as a prop — no internal…

agent-ready

Props

PropTypeRequiredDefaultDescription
isOpenboolean--
onClose() => void--
movementMovementData--

MoveSparePartModal

Two-step modal for moving a single spare part. Step one shows the part details with its current location and status and lets the user pick a new location, status, and observation; step two previews t…

agent-ready

Props

PropTypeRequiredDefaultDescription
isOpenboolean | undefined--
onCloseVoidFunction | undefined--
sparePartMoveSparePartModalSparePart | undefined--
requestedValues{ location?: string | undefined; status?: string | undefined; } | undefined--
locationOptionsFormSelectOption[]--
statusOptionsFormSelectOption[]--
onSubmit(values: { location: string; status: string; observation: string; }, sparePart: MoveSparePartModalSparePart) => void | Promise<void>--

SparePartSubTypesModal

Modal for viewing and adding spare part subtypes per part type. Presents a part-type tab strip, a table of existing subtypes for the active type, and an inline add form. Receives the active part type…

agent-ready

Props

PropTypeRequiredDefaultDescription
isOpenboolean--
onCloseVoidFunction--
partTypesSparePartSubTypesModalPartType[]--
activePartTypeIdstring--
onPartTypeChange(id: string) => void--
subTypesstring[]--
onAddSubType(name: string) => Promise<void | { error?: string | undefined; }>--
isLoadingboolean | undefined--

On this page