import styles from './damages.module.css';

import Damage from './damage.jsx';

export default function Damages({damages, scale}) {
  const elements = [];
  for (const key in damages) {
    elements.push(
      <Damage
        damage={damages[key]}
        key={key}
        scale={scale}
        zIndex={key}
      />
    );
  }
  if (0 === elements.length) {
    return false;
  }
  return <div className={styles.damages}>{elements}</div>;
}

