setIsPopoverOpen(!isPopoverOpen)}
+ data-test-subj="agentsCountsButton"
+ >
+ {agentCount}
+
+ }
+ >
+
+ {i18n.translate('xpack.fleet.agentsCountsBreakdown.popover.title', {
+ defaultMessage: 'Agents breakdown',
+ })}
+
+
+
+
+ {i18n.translate('xpack.fleet.agentsCountsBreakdown.popover.heading', {
+ defaultMessage: 'Top values',
+ })}
+
+
+
+ {topFivePolicies.map((agentPolicy) => (
+
+
+
+
+ {agentPolicy.name}
+
+
+
+ {agentPolicy?.agents && agentPolicy.agents > 0 ? (
+
+ {agentPolicy.agents}
+
+ ) : (
+ 0
+ )}
+
+
+
+
+ ))}
+
+ {agentCount > 0 ? (
+
+
+ {i18n.translate('xpack.fleet.agentsCountsBreakdown.popover.button', {
+ defaultMessage: 'View all {agentCount, plural, one {# agent} other {# agents}}',
+ values: { agentCount },
+ })}
+
+
+ ) : null}
+
+
+ >
+ );
};
diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/package_policies.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/package_policies.tsx
index b475c4d39d767..300de597f6900 100644
--- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/package_policies.tsx
+++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/package_policies.tsx
@@ -20,8 +20,6 @@ import {
import { i18n } from '@kbn/i18n';
import { FormattedRelative, FormattedMessage } from '@kbn/i18n-react';
-import { policyHasFleetServer } from '../../../../../../../../common/services';
-
import { InstallStatus } from '../../../../../types';
import type { GetAgentPoliciesResponseItem, InMemoryPackagePolicy } from '../../../../../types';
import {
@@ -54,6 +52,7 @@ interface PackagePoliciesPanelProps {
interface InMemoryPackagePolicyAndAgentPolicy {
packagePolicy: InMemoryPackagePolicy;
agentPolicies: GetAgentPoliciesResponseItem[];
+ rowIndex: number;
}
const IntegrationDetailsLink = memo<{
@@ -89,6 +88,8 @@ export const PackagePoliciesPage = ({ name, version }: PackagePoliciesPanelProps
const [flyoutOpenForPolicyId, setFlyoutOpenForPolicyId] = useState