=> {
try {
await lib.management.deleteProduct(state.token, deleting.id);
setNotif({
message: i18n.str`Product "${deleting.description}" (ID: ${deleting.id}) has been deleted`,
type: "SUCCESS",
});
} catch (error) {
setNotif({
message: i18n.str`Failed to delete product`,
type: "ERROR",
description: error instanceof Error ? error.message : undefined,
});
}
setDeleting(null);
}}
>
If you delete the product named "{deleting.description}" (ID:{" "}
{deleting.id}), the stock and related information will be lost
Deleting an product cannot be undone.