From 774113edda1b9219001ef4adab3f4e19c46bcecc Mon Sep 17 00:00:00 2001
From: piotrruss <mail@pruss.it>
Date: Sat, 21 May 2022 18:42:30 +0100
Subject: refactor

---
 components/Main.jsx | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 components/Main.jsx

(limited to 'components/Main.jsx')

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
-- 
cgit v1.2.3

