Skip to content

Commit

Permalink
[Searchprofiler] Spacing between rendered shards (elastic#60238)
Browse files Browse the repository at this point in the history
* Added unique key and some spacing to rendered shards

* Give key to React.Fragment
  • Loading branch information
jloleysens committed Mar 16, 2020
1 parent a0605fd commit c307678
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React, { memo } from 'react';
import React, { memo, Fragment } from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';

import { IndexDetails } from './index_details';
Expand Down Expand Up @@ -53,13 +53,11 @@ export const ProfileTree = memo(({ data, target, onHighlight }: Props) => {
</EuiFlexItem>
<EuiSpacer size="s" />
<EuiFlexItem grow={false}>
{index.shards.map(shard => (
<ShardDetails
key={shard.id[1]}
index={index}
shard={shard}
operations={shard[target]!}
/>
{index.shards.map((shard, idx) => (
<Fragment key={shard.id[1] + `_${idx}`}>
<ShardDetails index={index} shard={shard} operations={shard[target]!} />
{idx < index.shards.length - 1 ? <EuiSpacer size="s" /> : undefined}
</Fragment>
))}
</EuiFlexItem>
</EuiFlexGroup>
Expand Down

0 comments on commit c307678

Please sign in to comment.