import{__rest as e,__assign as o}from"../../node_modules/tslib/tslib.es6.js";import t,{useCallback as n}from"react";import{AlertDialog as l,AlertDialogContent as r}from"../../node_modules/@chakra-ui/modal/dist/esm/alert-dialog.js";import{ModalOverlay as i,ModalHeader as a,ModalBody as s,ModalFooter as c}from"../../node_modules/@chakra-ui/modal/dist/esm/modal.js";import{Stack as m}from"../../node_modules/@chakra-ui/layout/dist/esm/stack.js";import{Button as d}from"../../node_modules/@chakra-ui/button/dist/esm/button.js";var u=function(n){var u=n.onClose,f=n.handleConfirmation,p=n.buttonLabel,v=n.open,E=n.children,g=n.title,C=n.errorMessages,h=void 0===C?"":C;n.dialogBodySize;var b=n.size,k=void 0===b?"3xl":b;n.colorScheme;var S=e(n,["onClose","handleConfirmation","buttonLabel","open","children","title","errorMessages","dialogBodySize","size","colorScheme"]),j=t.useRef();return t.createElement(l,o({size:k,isOpen:v,leastDestructiveRef:j,onClose:u,isCentered:!0},S),t.createElement(i,null,t.createElement(r,null,t.createElement(a,{fontSize:"lg",fontWeight:"bold",id:"confirmation-dialog-title"},g),t.createElement(s,{overflowY:"scroll"},E),t.createElement(c,null,t.createElement(m,{justifyContent:"space-between",direction:"row",align:"center",width:"100%"},t.createElement(m,{spacing:4,direction:"row",align:"center"},h.split("\n").map((function(e){return t.createElement("div",{style:{color:"red"},key:e},e)}))),t.createElement(m,{spacing:4,direction:"row",align:"center"},t.createElement(d,{autoFocus:!0,onClick:u,variant:"outline"},"Cancel"),t.createElement(d,{onClick:f,variant:"solid"},p)))))))},f=function(l){var r=l.open,i=l.onClose,a=l.onSave,s=e(l,["open","onClose","onSave"]),c=n((function(){a()}),[a]);return r?t.createElement("div",null,t.createElement(u,o({open:r,onClose:i,handleConfirmation:c},s))):t.createElement(t.Fragment,null)};export{f as GenericDialog};
//# sourceMappingURL=GenericDialog.js.map
