diff options
Diffstat (limited to 'components/Main.jsx')
-rw-r--r-- | components/Main.jsx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/components/Main.jsx b/components/Main.jsx new file mode 100644 index 0000000..3f48c3e --- /dev/null +++ b/components/Main.jsx @@ -0,0 +1,26 @@ +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 |