feat(react/dialogs): port incorrect_cpu_arch

This commit is contained in:
Elian Doran
2025-08-05 15:39:49 +03:00
parent 8f0a9f91c1
commit 79c5d479fc
4 changed files with 65 additions and 63 deletions

View File

@@ -9,6 +9,7 @@ interface ModalProps {
size: "lg" | "md" | "sm";
children: ComponentChildren;
footer?: ComponentChildren;
footerAlignment?: "right" | "between";
maxWidth?: number;
zIndex?: number;
/**
@@ -30,7 +31,7 @@ interface ModalProps {
helpPageId?: string;
}
export default function Modal({ children, className, size, title, footer, onShown, onSubmit, helpPageId, maxWidth, zIndex, scrollable, onHidden: onHidden }: ModalProps) {
export default function Modal({ children, className, size, title, footer, footerAlignment, onShown, onSubmit, helpPageId, maxWidth, zIndex, scrollable, onHidden: onHidden }: ModalProps) {
const modalRef = useRef<HTMLDivElement>(null);
if (onShown || onHidden) {
@@ -100,7 +101,12 @@ export default function Modal({ children, className, size, title, footer, onShow
);
}
function ModalInner({ children, footer }: Pick<ModalProps, "children" | "footer">) {
function ModalInner({ children, footer, footerAlignment }: Pick<ModalProps, "children" | "footer" | "footerAlignment">) {
const footerStyle: CSSProperties = {};
if (footerAlignment === "between") {
footerStyle.justifyContent = "space-between";
}
return (
<>
<div className="modal-body">
@@ -108,7 +114,7 @@ function ModalInner({ children, footer }: Pick<ModalProps, "children" | "footer"
</div>
{footer && (
<div className="modal-footer">
<div className="modal-footer" style={footerStyle}>
{footer}
</div>
)}