Return

All tests / SidesShift index.tsx

100% Statements 6/6
50% Branches 1/2
100% Functions 1/1
100% Lines 5/5

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 27 28 29 301x 1x 1x                               1x                   1x  
import styles from './sides.module.css';
import { TfiMinus } from 'react-icons/tfi';
import { clx } from '@/helpers';
 
type Props = {
    handleClick?: () => void;
    leftPosition?: boolean;
    className?: string;
};
 
/**
 * @example
 *     <SidesShift />;
 *
 * @param {function} handleClick - The function to be called when the button is clicked
 * @param {boolean} leftPosition - If true, the button will be positioned on the left
 * @returns {JSX.Element}
 */
const ShidesShift = ({ handleClick, leftPosition, className }: Props) => {
    return (
        <TfiMinus
            data-testid="sides-shift"
            className={clx(styles.swap, className, leftPosition ? styles.left : '')}
            onClick={handleClick}
        />
    );
};
 
export default ShidesShift;