December-software-project/sort-algo

View on GitHub
src/visualizer/sortingvisualizer/component/multipleblocks/HorizontalArray.js

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
import React from 'react';
import './styles.css';

/**
 * Horizontal array representation of the entire array.
 *
 * @component
 * @category MultipleBlocks
 * @param referenceArray Current state of the data array.
 * @param BlockType Used to represent each item in the data array.
 * @returns {JSX.Element} Horizontal array component.
 */
const HorizontalArray = ({ referenceArray, BlockType }) => {
  return (
    <div className="horiz-arr">
      {referenceArray.map((x) => (
        <BlockType item={x} key={x.id} />
      ))}
    </div>
  );
};

export default HorizontalArray;