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

import Damage from './damage.jsx';

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

