fleet/frontend/components/ModalFooter/ModalFooter.tsx
jacobshandling 85e826a094
UI: Add ability to run scripts on batches of hosts (#28563)
## For #28159 

- Implement UI capability to run scripts on batches of hosts at a time
  - Add new hosts table `Run script` primary action, triggers
- new `RunScriptBatch` modal, allows running scripts on the selected
batch of hosts
- new `RunScriptBatchPaginatedList`, handles logic specific to this
modal, and utilizes the now more flexible `PaginatedList` component
- Widen capabilities of `PaginatedList` component to elegantly handle
more diverse applications, including this one
- Widen capabilities of `ScriptDetailsModal` component to elegantly
handle more diverse applications, including this one
- Streamline updating `state`s on manage hosts page
- Clearer, more concise naming

- [x] Changes file added for user-visible changes in `changes/`
- [x] A detailed QA plan exists on the associated ticket (if it isn't
there, work with the product group's QA engineer to add it)
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2025-04-28 16:32:41 -07:00

44 lines
1 KiB
TypeScript

import React from "react";
import classnames from "classnames";
import { COLORS } from "styles/var/colors";
const baseClass = "modal-footer";
interface IModalFooterProps {
primaryButtons: React.ReactNode;
secondaryButtons?: React.ReactNode;
className?: string;
/** Renders a line above action buttons to indicate scrollability */
isTopScrolling?: boolean;
}
const ModalFooter = ({
primaryButtons,
secondaryButtons,
className,
isTopScrolling = false,
}: IModalFooterProps): JSX.Element => {
const classes = classnames(className, `${baseClass}__content-wrapper`);
return (
<div
className={classes}
style={{
borderTop: isTopScrolling
? `1px solid ${COLORS["ui-fleet-black-10"]}`
: "none",
}}
>
<div className={`${baseClass}__primary-buttons-wrapper`}>
{primaryButtons}
</div>
{secondaryButtons && (
<div className={`${baseClass}__secondary-buttons-wrapper`}>
{secondaryButtons}
</div>
)}
</div>
);
};
export default ModalFooter;