Files
meshtastic-web/src/components/Sidebar/Channels/ChannelList.tsx
T
2021-08-03 19:37:36 +10:00

20 lines
504 B
TypeScript

import React from 'react';
import { Protobuf } from '@meshtastic/meshtasticjs';
import { useAppSelector } from '../../../hooks/redux';
import { Channel } from './Channel';
export const ChannelList = (): JSX.Element => {
const channels = useAppSelector((state) => state.meshtastic.channels);
return (
<>
{channels.map((channel, index) => {
if (channel.role !== Protobuf.Channel_Role.DISABLED)
return <Channel key={index} channel={channel} />;
})}
</>
);
};