UNPKG

@nexusui/components

Version:

These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.

2 lines (1 loc) 663 B
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),r=require("./Dialog.container.js"),o=require("../locales/index.js"),i=require("./locale.json.js");exports.ConfirmationDialogComponent=t=>{const{onConfirm:c,onCancel:a,confirmAction:s={},cancelAction:l={},extraAction:u,...m}=t,f=o.useTranslate(i.default),C=n.useMemo((()=>({children:f("Confirm"),variant:"contained",onClick:c,...s})),[c,s,f]),d=n.useMemo((()=>({children:f("Cancel"),onClick:a,...l})),[a,l,f]),j=n.useMemo((()=>{if(u)return[u]}),[u]),x=n.useMemo((()=>[d,C]),[d,C]);return e.jsx(r.Dialog,{leftActions:j,rightActions:x,...m})};