2021-04-14 15:13:55 +10:00
|
|
|
import React from 'react';
|
2021-04-19 11:34:13 +10:00
|
|
|
import Send from './Send';
|
2021-04-14 15:13:55 +10:00
|
|
|
|
|
|
|
|
interface Props {
|
2021-04-14 15:23:00 +10:00
|
|
|
lines: string[]
|
2021-04-14 15:13:55 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface State {
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-19 11:34:13 +10:00
|
|
|
|
2021-04-16 11:32:00 +10:00
|
|
|
export default class Room extends React.Component<Props, State> {
|
2021-04-14 15:13:55 +10:00
|
|
|
render() {
|
|
|
|
|
return (
|
2021-04-19 11:34:13 +10:00
|
|
|
<div>
|
|
|
|
|
<Send />
|
|
|
|
|
<div className='room'>
|
|
|
|
|
{this.renderLines(this.props.lines)}
|
|
|
|
|
</div>
|
2021-04-14 15:13:55 +10:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-14 15:23:00 +10:00
|
|
|
renderLines(lines: string[]) {
|
2021-04-14 15:13:55 +10:00
|
|
|
|
2021-04-14 15:23:00 +10:00
|
|
|
const renderedLines = [];
|
|
|
|
|
for (const line of lines) {
|
2021-04-16 11:32:00 +10:00
|
|
|
renderedLines.push(<div className='room-row'>{line}</div>);
|
2021-04-14 15:13:55 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
2021-04-14 15:23:00 +10:00
|
|
|
{renderedLines}
|
2021-04-14 15:13:55 +10:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|