import { List, Edit } from '.'
import { useState } from 'react'

const Main = ({ session, setSession, showError }) => {
  const [edit, setEdit] = useState(null)

  return edit
    ? (
      <Edit
        edit={edit}
        setEdit={setEdit}
        session={session}
        setSession={setSession}
        showError={showError}
      />
    ) : (
      <List
        session={session}
        setSession={setSession}
        showError={showError}
        setEdit={setEdit}
      />
    )
}

export default Main
