UI housekeeping: Update Modal.children from JSX.Element to React.ReactNode, remove empty fragment wrappers (#41394)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Refactor**
* Simplified modal structures across multiple dialog components for
improved code maintainability.
* Enhanced modal component's flexibility to support broader content
types.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
jacobshandling
2026-03-10 15:30:55 -07:00
committed by GitHub
parent 107dcb19d8
commit 0db86ef2f1
74 changed files with 2005 additions and 2174 deletions
@@ -431,16 +431,14 @@ export const SoftwareInstallDetailsModal = ({
onEnter={onCancel}
className={baseClass}
>
<>
{renderContent()}
<ModalButtons
deviceAuthToken={deviceAuthToken}
status={swInstallResult?.status}
hostSoftwareId={hostSoftware?.id}
onRetry={onRetry}
onCancel={onCancel}
/>
</>
{renderContent()}
<ModalButtons
deviceAuthToken={deviceAuthToken}
status={swInstallResult?.status}
hostSoftwareId={hostSoftware?.id}
onRetry={onRetry}
onCancel={onCancel}
/>
</Modal>
);
};
@@ -430,16 +430,14 @@ export const SoftwareIpaInstallDetailsModal = ({
onEnter={onCancel}
className={baseClass}
>
<>
{renderContent()}
<ModalButtons
deviceAuthToken={deviceAuthToken}
hostSoftwareId={hostSoftware?.id}
onRetry={onRetry}
onCancel={onCancel}
displayStatus={displayStatus}
/>
</>
{renderContent()}
<ModalButtons
deviceAuthToken={deviceAuthToken}
hostSoftwareId={hostSoftware?.id}
onRetry={onRetry}
onCancel={onCancel}
displayStatus={displayStatus}
/>
</Modal>
);
};
@@ -327,16 +327,14 @@ export const SoftwareScriptDetailsModal = ({
onEnter={onCancel}
className={baseClass}
>
<>
{renderContent()}
<ModalButtons
deviceAuthToken={deviceAuthToken}
installResultStatus={swInstallResult?.status}
hostSoftwareId={hostSoftware?.id}
onRerun={onRerun}
onCancel={onCancel}
/>
</>
{renderContent()}
<ModalButtons
deviceAuthToken={deviceAuthToken}
installResultStatus={swInstallResult?.status}
hostSoftwareId={hostSoftware?.id}
onRerun={onRerun}
onCancel={onCancel}
/>
</Modal>
);
};
@@ -271,16 +271,14 @@ const SoftwareUninstallDetailsModal = ({
onEnter={onCancel}
className={baseClass}
>
<>
{renderContent()}
<ModalButtons
uninstallStatus={uninstallStatus}
deviceAuthToken={deviceAuthToken}
onCancel={onCancel}
onRetry={onRetry}
hostSoftware={hostSoftware}
/>
</>
{renderContent()}
<ModalButtons
uninstallStatus={uninstallStatus}
deviceAuthToken={deviceAuthToken}
onCancel={onCancel}
onRetry={onRetry}
hostSoftware={hostSoftware}
/>
</Modal>
);
};
@@ -484,16 +484,14 @@ export const VppInstallDetailsModal = ({
onEnter={onCancel}
className={baseClass}
>
<>
{renderContent()}
<ModalButtons
deviceAuthToken={deviceAuthToken}
hostSoftwareId={hostSoftware?.id}
onRetry={onRetry}
onCancel={onCancel}
displayStatus={displayStatus}
/>
</>
{renderContent()}
<ModalButtons
deviceAuthToken={deviceAuthToken}
hostSoftwareId={hostSoftware?.id}
onRetry={onRetry}
onCancel={onCancel}
displayStatus={displayStatus}
/>
</Modal>
);
};
+1 -1
View File
@@ -10,7 +10,7 @@ type ModalWidth = "medium" | "large" | "xlarge" | "auto";
export interface IModalProps {
title: string | JSX.Element;
children: JSX.Element;
children: React.ReactNode;
onExit: () => void;
onEnter?: () => void;
/** medium 650px, large 800px, xlarge 850px, auto auto-width