import { Modal, Input, List, Button } from 'antd'; import { ChannelsWrapper, AddFooter } from './Channels.styled'; import { CommentOutlined, SearchOutlined } from '@ant-design/icons'; import { useChannels } from './useChannels.hook'; import { ChannelItem } from './channelItem/ChannelItem'; import { AddChannel } from './addChannel/AddChannel'; export function Channels({ open }) { const { state, actions } = useChannels(); const addChannel = async () => { try { const id = await actions.addChannel(); actions.clearShowAdd(); open(id); } catch(err) { Modal.error({ title: 'Failed to Create Channel', content: 'Please try again.', }); } }; const addFooter = ( ); return (
( )} />
{ state.display !== 'small' && (
New Channel
)}
); }