Feat(PhoneApp): PhoneList

This commit is contained in:
chip committed 2020-08-23 01:28:28 +02:00
1 parent 863f908f05
commit 00856fe87a
1 file changed
+24
+24
View File
@@ -0,0 +1,24 @@
import React from 'react';
import List from "@material-ui/core/List";
import ListItem from "@material-ui/core/ListItem";
import ListItemText from "@material-ui/core/ListItemText";
import PhoneCallbackIcon from '@material-ui/icons/PhoneCallback';
import PhoneForwardedIcon from '@material-ui/icons/PhoneForwarded';
export const PhoneList = ({ calls }) => {
const CallTypeIcon = {'incoming': <PhoneCallbackIcon />, 'outgoing': <PhoneForwardedIcon />}
return (
<List>
{calls.map((call) => (
<ListItem key={call.id} divider>
<ListItemText
primary={call.caller}
secondary={call.phoneNumber}
/>
{CallTypeIcon[call.type]}
</ListItem>
))}
</List>
)
}