import Grid from '@mui/material/Grid'
import SearchList from './SearchList'
import CredentialsList from './CredentialsList'
import EditBar from './EditBar'
import { TRightIsOpen } from '../../../typescript/redux/control/types'

const RightBar = ({rightIsOpen}:{rightIsOpen:TRightIsOpen}) => {
  return (
    <Grid item lg={rightIsOpen?4:0}>
      {rightIsOpen === 'credentials' && <CredentialsList />}
      {rightIsOpen === 'search' && <SearchList />}
      {rightIsOpen === 'edit' && <EditBar/>}
    </Grid>
   )
}

export default RightBar