import Message from './message.jsx';

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

export default function Messages({chatMessages}) {
  const messages = [];
  for (const key in chatMessages) {
    messages.push(
      <Message
        key={key}
        letters={chatMessages[key]}
      />,
    );
  }
  return (
    <div className={styles.messages}>
      {messages}
   </div>
  )
}