Skip to content

Commit

Permalink
feat(pci.private-network): split object from usememo for slicedregion
Browse files Browse the repository at this point in the history
ref: -1826
Signed-off-by: tsiorifamonjena <[email protected]>
  • Loading branch information
Tsiorifamonjena committed Nov 26, 2024
1 parent e9ad7d2 commit 5b30b64
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@ const SlicedRegions: FC<{ regions: string[]; length: number }> = ({
regions,
length,
}) => {
const { formattedRegion, slicedText } = useMemo(
() => ({
formattedRegion: regions.join(', '),
slicedText:
regions.length > length
? regions
.slice(0, length)
.concat('...')
.join(', ')
: '',
}),
const formattedRegion = useMemo(() => regions.join(', '), [regions]);
const slicedText = useMemo(
() =>
regions.length > length
? regions
.slice(0, length)
.concat('...')
.join(', ')
: '',
[regions, length],
);

Expand Down

0 comments on commit 5b30b64

Please sign in to comment.