import { useSelector } from 'react-redux'
import SearchList from './SearchList'
import CredentialsList from './CredentialsList'
import EditBar from './EditBar'
import { getIsOpen } from '../../../../../redux/control/selector'


const RightListsAndBars = () => {
  const isOpen = useSelector(getIsOpen)
  return (
    <>
      {isOpen === 'credentials' && <CredentialsList />}
      {isOpen === 'search' && <SearchList />}
      {isOpen === 'edit' && <EditBar/>}
    </>
   )
}

export default RightListsAndBars