blob: 38f12917328747c3392816e279fc00005b6fdbce [file] [log] [blame]
Adrien Béraude74741b2021-04-19 13:22:54 -04001import React from 'react'
2import { Avatar, List, ListItem, ListItemAvatar, ListItemText } from '@material-ui/core'
3import { PersonRounded } from '@material-ui/icons';
Adrien Béraud6ecaa402021-04-06 17:37:25 -04004
Adrien Béraude74741b2021-04-19 13:22:54 -04005export default function AccountList(props) {
6 return <List>
7 {
8 props.accounts.map(account => {
9 const displayName = account.getDisplayNameNoFallback()
10 return <ListItem button key={account.getId()} onClick={() => props.onClick(account)}>
11 <ListItemAvatar>
12 <Avatar>{displayName ? displayName[0].toUpperCase() : <PersonRounded />}</Avatar>
13 </ListItemAvatar>
14 <ListItemText primary={account.getDisplayName()} secondary={account.getDisplayUri()} />
15 </ListItem>
16 })
17 }
18 </List>
Adrien Béraud6ecaa402021-04-06 17:37:25 -040019}