File size: 523 Bytes
2d93ee9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import PropTypes from 'prop-types'
import '../styles/chat.css'

function SessionList({ sessions, current }) {
  return (
    <div className="session-list">
      {sessions.map((name) => (
        <span
          key={name}
          className={`session-item ${name === current ? 'active' : ''}`}
        >
          {name}
        </span>
      ))}
    </div>
  )
}

SessionList.propTypes = {
  sessions: PropTypes.arrayOf(PropTypes.string).isRequired,
  current: PropTypes.string.isRequired,
}

export default SessionList