You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
473 B
19 lines
473 B
import { useAppContext } from '../Contexts/AppContext'; |
|
|
|
export const Messages = () => { |
|
const { messages, currentChannel } = useAppContext(); |
|
|
|
return ( |
|
<> |
|
{messages |
|
? messages |
|
.filter((msg) => msg.channel_id === currentChannel?.id) |
|
.map((msg) => ( |
|
<div key={msg?.id}> |
|
{msg.inserted_at}: {msg.author.username} {msg.message} |
|
</div> |
|
)) |
|
: 'loading'} |
|
</> |
|
); |
|
};
|
|
|