mirror of
https://github.com/fleetdm/fleet
synced 2026-04-22 05:57:36 +00:00
## Issue - First batch of @iansltx 's work of cleaning up lint warnings #43387 ## Description - Quick PR review and grabbed as many confirmed low-risk quick wins as I could `git checkout lint-cleanup <file/path/1> <file/path/2>` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes This release contains internal code improvements with one minor UI tweak: * **Style** * Dropdown menu background color adjusted for clearer contrast in action lists * **Refactor** * Improved type safety across the codebase with stricter TypeScript annotations * Removed unused imports and constants to reduce code clutter * Enhanced React hook dependency arrays for more consistent component behavior <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Rachel Perkins <rachel@Rachels-MacBook-Pro.local> Co-authored-by: Ian Littman <iansltx@gmail.com>
50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
import React from "react";
|
|
import { DEFAULT_EMPTY_CELL_VALUE } from "utilities/constants";
|
|
import Icon from "components/Icon";
|
|
import NotSupported from "components/NotSupported";
|
|
import TooltipWrapper from "components/TooltipWrapper";
|
|
import { IHost } from "interfaces/host";
|
|
|
|
const baseClass = "host-mdm-status-cell";
|
|
|
|
const HostMdmStatusCell = ({
|
|
row: {
|
|
original: { mdm, platform },
|
|
},
|
|
cell: { value },
|
|
}: {
|
|
row: { original: IHost };
|
|
cell: { value: string };
|
|
}): JSX.Element => {
|
|
if (platform === "chrome") {
|
|
return NotSupported;
|
|
}
|
|
|
|
if (!value) {
|
|
return <span className={`${baseClass}`}>{DEFAULT_EMPTY_CELL_VALUE}</span>;
|
|
}
|
|
|
|
return (
|
|
<span className={`${baseClass}`}>
|
|
{value}
|
|
{mdm?.dep_profile_error && (
|
|
<TooltipWrapper
|
|
tipContent={
|
|
<span className="tooltip__tooltip-text">
|
|
Fleet hit Apple's API rate limit when preparing the macOS
|
|
Setup Assistant for this host. Fleet will try again every hour.
|
|
</span>
|
|
}
|
|
position="top"
|
|
underline={false}
|
|
showArrow
|
|
tipOffset={8}
|
|
>
|
|
<Icon name="error-outline" color="status-error" size="medium" />
|
|
</TooltipWrapper>
|
|
)}
|
|
</span>
|
|
);
|
|
};
|
|
|
|
export default HostMdmStatusCell;
|