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. Rece…
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.
import { ConfirmDeleteSparePartModal } from "@tetherto/mdk-react-devkit";| Prop | Status | Type | Default | Description |
|---|---|---|---|---|
isOpen | Optional | boolean | undefined | — | — |
onClose | Optional | VoidFunction | undefined | — | — |
onConfirm | Optional | ((sparePart: ConfirmDeleteSparePartModalSparePart) => void | Promise<void>) | undefined | — | — |
sparePart | Optional | ConfirmDeleteSparePartModalSparePart | undefined | — | — |
isLoading | Optional | boolean | undefined | — | — |
Usage
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.
When to use
Use this as the confirm step for a destructive "Delete" row action in a spare-parts inventory view.
Example
import { useState } from "react";import { Button, ConfirmDeleteSparePartModal } from "@tetherto/mdk-react-devkit";export const ConfirmDeleteSparePartModalExample = () => { const [isOpen, setIsOpen] = useState(false); return ( <div> <Button variant="danger" onClick={() => setIsOpen(true)}> Delete Spare Part </Button> <ConfirmDeleteSparePartModal isOpen={isOpen} onClose={() => setIsOpen(false)} onConfirm={async () => setIsOpen(false)} sparePart={{ id: "sp-001", code: "HB-A001" }} /> </div> );};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.…
MovementDetailsModal
Modal showing the details of a historical device movement — the device summary plus the origin → destination transition of location and status. Receives the …