Add ModalActions to Modal component

This commit is contained in:
Mathias Wagner
2025-09-09 13:42:09 +02:00
parent 54be320dc1
commit 5908ee0f99
3 changed files with 32 additions and 1 deletions

View File

@@ -63,3 +63,20 @@ export const Modal = ({
</div>
);
};
export const ModalActions = ({
children,
className = '',
align = 'right',
...rest
}) => {
const alignClass = align === 'left' ? 'modal-actions--left' :
align === 'center' ? 'modal-actions--center' :
'modal-actions--right';
return (
<div className={`modal-actions ${alignClass} ${className}`} {...rest}>
{children}
</div>
);
};

View File

@@ -1 +1 @@
export { Modal as default } from './Modal.jsx';
export { Modal as default, ModalActions } from './Modal.jsx';

View File

@@ -57,6 +57,20 @@
overflow-y: auto
flex: 1
.modal-actions
display: flex
gap: 0.75rem
margin-top: 1.5rem
&--left
justify-content: flex-start
&--center
justify-content: center
&--right
justify-content: flex-end
@keyframes modalIn
from
opacity: 0