diff --git a/src/dialog/AlertDialog.jsx b/src/dialog/AlertDialog.jsx index ce989a9..a430249 100644 --- a/src/dialog/AlertDialog.jsx +++ b/src/dialog/AlertDialog.jsx @@ -21,7 +21,13 @@ export function useAlertDialog({ title, message, ...footerProps }) { }; } -export function AlertDialog({ title, message, children, onClose, closeLabel }) { +export function AlertDialog({ + title = 'Atention required', + message, + children, + onClose = () => {}, + closeLabel = 'Close', +}) { return ( {}, - title: 'Atention required', - closeLabel: 'Close', -}; - AlertDialog.propTypes = { children: PropTypes.node, message: PropTypes.node, @@ -47,17 +47,13 @@ AlertDialog.propTypes = { closeLabel: PropTypes.node, }; -function AlertDialogFooter({ close, onClose, closeLabel }) { +function AlertDialogFooter({ close, onClose = () => {}, closeLabel = 'Close' }) { return ( ); } -AlertDialogFooter.defaultProps = { - onClose: () => {}, - closeLabel: 'Close', -}; AlertDialogFooter.propTypes = { close: PropTypes.func, diff --git a/src/dialog/ConfirmationDialog.jsx b/src/dialog/ConfirmationDialog.jsx index 596b4de..0bdb045 100644 --- a/src/dialog/ConfirmationDialog.jsx +++ b/src/dialog/ConfirmationDialog.jsx @@ -22,7 +22,7 @@ export function useConfirmationDialog({ title, message, ...footerProps }) { }; } -export function ConfirmationDialog({ title, message, children, ...footerProps }) { +export function ConfirmationDialog({ title = 'Atention required', message, children, ...footerProps }) { return ( {}, + onCancel = () => {}, + cancelLabel = 'Cancel', + proceedLabel = 'Proceed', + proceedType = 'primary', +}) { return ( <>