Skip to content

Commit 1f8e938

Browse files
authored
[Searchprofiler] Spacing between rendered shards (#60238)
* Added unique key and some spacing to rendered shards * Give key to React.Fragment
1 parent dd7531d commit 1f8e938

File tree

1 file changed

+6
-8
lines changed
  • x-pack/plugins/searchprofiler/public/application/components/profile_tree

1 file changed

+6
-8
lines changed

x-pack/plugins/searchprofiler/public/application/components/profile_tree/profile_tree.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7-
import React, { memo } from 'react';
7+
import React, { memo, Fragment } from 'react';
88
import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';
99

1010
import { IndexDetails } from './index_details';
@@ -53,13 +53,11 @@ export const ProfileTree = memo(({ data, target, onHighlight }: Props) => {
5353
</EuiFlexItem>
5454
<EuiSpacer size="s" />
5555
<EuiFlexItem grow={false}>
56-
{index.shards.map(shard => (
57-
<ShardDetails
58-
key={shard.id[1]}
59-
index={index}
60-
shard={shard}
61-
operations={shard[target]!}
62-
/>
56+
{index.shards.map((shard, idx) => (
57+
<Fragment key={shard.id[1] + `_${idx}`}>
58+
<ShardDetails index={index} shard={shard} operations={shard[target]!} />
59+
{idx < index.shards.length - 1 ? <EuiSpacer size="s" /> : undefined}
60+
</Fragment>
6361
))}
6462
</EuiFlexItem>
6563
</EuiFlexGroup>

0 commit comments

Comments
 (0)