import { Box, Grid, List, ListItem, ListItemText } from '@material-ui/core'; import React from 'react'; import { ChatMessage } from 'waku-chat/chat_message'; import MessageInput from './MessageInput'; import Send from './Send'; interface Props { lines: ChatMessage[], } interface State { messageToSend: string } export default class Room extends React.Component { constructor(props: Props) { super(props); this.state = { messageToSend: '' }; } messageHandler(msg: string) { this.setState({ messageToSend: msg }); } render() { return ( ); } } interface LinesProps { messages: ChatMessage[] } const Lines = (props: LinesProps) => { const renderedLines = []; for (const i in props.messages) { renderedLines.push( ); } return ( {renderedLines} ); }; // TODO: Make it a proper component function printMessage(chatMsg: ChatMessage) { const timestamp = chatMsg.timestamp.toLocaleString([], { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit', hour12: false }); return `<${timestamp}> ${chatMsg.nick}: ${chatMsg.message}`; }