All files / components/layout/Frame Frame.tsx

100% Statements 8/8
100% Branches 0/0
100% Functions 3/3
100% Lines 8/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 271x 1x 1x           1x 17x     480x     28800x                   1x  
import {forwardRef} from 'react';
import styles from './Frame.module.scss';
import Shape from '../../ui/Shape/Shape';
 
interface Props {
    isElements: number[][]
}
 
const Frame = forwardRef<HTMLDivElement, Props>(({isElements}, frameElement ) => {
    return (
        <div ref={frameElement} className={styles['frame']}>
            {isElements.map((shapes, i: number) => {
                return (
                    <div className={styles['frame__row']} key={`${i}_frame_row`}>
                        {shapes.map((_, j: number ) => {
                            return (
                                <Shape id={`${i}_${j}`} isActive={!!isElements[i][j]} key={`${i}_${j}_shape`} />
                            );
                        })}
                    </div>
                );
            })}
        </div>
    );
});
export default Frame;