MDK Logo
ReferenceUI KitReactUI Kit foundationComponentsDialogs

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";
PropStatusTypeDefaultDescription
isOpenOptionalboolean | undefined
onCloseOptionalVoidFunction | undefined
onConfirmOptional((sparePart: ConfirmDeleteSparePartModalSparePart) => void | Promise<void>) | undefined
sparePartOptionalConfirmDeleteSparePartModalSparePart | undefined
isLoadingOptionalboolean | 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>  );};