import React, { useEffect } from 'react'; import SlackChannelList from './SlackChannelList/SlackChannelList'; import { fetchList, init } from 'Duck/integrations/slack'; import { connect } from 'react-redux'; import SlackAddForm from './SlackAddForm'; import { Button } from 'UI'; interface Props { onEdit?: (integration: any) => void; istance: any; fetchList: any; init: any; } const SlackForm = (props: Props) => { const [active, setActive] = React.useState(false); const onEdit = () => { setActive(true); }; const onNew = () => { setActive(true); props.init({}); } useEffect(() => { props.fetchList(); }, []); return (
{active && (
setActive(false)} />
)}

Slack

); }; SlackForm.displayName = 'SlackForm'; export default connect( (state: any) => ({ istance: state.getIn(['slack', 'instance']), }), { fetchList, init } )(SlackForm);