fleet/frontend/components/modals/ShowQueryModal/ShowQueryModal.tsx
kilo-code-bot[bot] e1fc1b08a8
Update modal 'Done' buttons to say 'Close' (#41751)
## Summary

- Changed all modal "Done" dismiss/close button labels to "Close" across
48 frontend component files
- Updated instructional text in `AutoEnrollMdmModal` that referenced the
"Done" button to say "Close" instead
- Updated 7 test files to assert "Close" instead of "Done" for modal
button names

## Excluded (intentionally not changed)

- `LiveResultsHeading.tsx` — "Done" button is a page-level navigation
action, not a modal dismiss
- `AddAbmModal.tsx` — Instructional text referencing Apple Business
Manager's "Done" button
- `Calendars.tsx` — Instructional text referencing Google Calendar's
"Done" button
- `ModalFooter.stories.tsx` — Storybook demo example

Built for
[Mel](https://fleetdm.slack.com/archives/D0AKX7DJFCN/p1773674157011109?thread_ts=1773673149.649299&cid=D0AKX7DJFCN)
by [Kilo for Slack](https://kilo.ai/features/slack-integration)

---------

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Co-authored-by: melpike <mel@fleetdm.com>
Co-authored-by: melpike <79950145+melpike@users.noreply.github.com>
2026-03-23 09:59:18 -06:00

51 lines
1.3 KiB
TypeScript

import React from "react";
import SQLEditor from "components/SQLEditor";
import Modal from "components/Modal";
import Button from "components/buttons/Button";
import PerformanceImpactCell from "components/TableContainer/DataTable/PerformanceImpactCell";
import { PerformanceImpactIndicator } from "interfaces/schedulable_query";
const baseClass = "show-query-modal";
interface IShowQueryModalProps {
onCancel: () => void;
query?: string;
impact?: PerformanceImpactIndicator;
}
const ShowQueryModal = ({
query,
impact,
onCancel,
}: IShowQueryModalProps): JSX.Element => {
return (
<Modal
title="Query"
onExit={onCancel}
onEnter={onCancel}
className={baseClass}
>
<div className={baseClass}>
<SQLEditor
value={query}
name="Query"
wrapperClassName={`${baseClass}__text-editor-wrapper`}
wrapEnabled
readOnly
/>
{impact && (
<div className={`${baseClass}__performance-impact`}>
Performance impact:{" "}
<PerformanceImpactCell value={{ indicator: impact }} />
</div>
)}
<div className="modal-cta-wrap">
<Button onClick={onCancel}>Close</Button>
</div>
</div>
</Modal>
);
};
export default ShowQueryModal;