@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) • 594 B
JavaScript
import{jsx as o}from"react/jsx-runtime";import{useMemo as n}from"react";import{Dialog as r}from"./Dialog.container.js";import{useTranslate as i}from"../locales/index.js";import t from"./locale.json.js";const c=c=>{const{onConfirm:e,onCancel:m,confirmAction:a={},cancelAction:l={},extraAction:f,...s}=c,p=i(t),C=n((()=>({children:p("Confirm"),variant:"contained",onClick:e,...a})),[e,a,p]),j=n((()=>({children:p("Cancel"),onClick:m,...l})),[m,l,p]),A=n((()=>{if(f)return[f]}),[f]),d=n((()=>[j,C]),[j,C]);return o(r,{leftActions:A,rightActions:d,...s})};export{c as ConfirmationDialogComponent};