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

import Dialogue from './dialogue.jsx';

export default function Dialogues({camera, dialogues, scale}) {
  const elements = [];
  for (const key in dialogues) {
    elements.push(
      <Dialogue
        camera={camera}
        dialogue={dialogues[key]}
        key={key}
        onClose={() => {
          delete dialogues[key];
        }}
        scale={scale}
      />
    );
  }
  return <div className={styles.dialogues}>{elements}</div>;
}

