From 39c37d3a7993cf1b726ee8ab80ac286f453c90b2 Mon Sep 17 00:00:00 2001
From: sowgro <tpoke.ferrari@gmail.com>
Date: Sun, 3 Nov 2024 14:23:06 -0500
Subject: Settings sidebar works now

---
 extension/src/Body.tsx | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 extension/src/Body.tsx

(limited to 'extension/src/Body.tsx')

diff --git a/extension/src/Body.tsx b/extension/src/Body.tsx
new file mode 100644
index 0000000..7d56265
--- /dev/null
+++ b/extension/src/Body.tsx
@@ -0,0 +1,23 @@
+import React, {useState} from "react";
+import SettingsEditor from "./SettingsEditor.tsx";
+import Folder from "./Folder.tsx";
+import imageUrl from "./assets/settings.svg"
+import BookmarkTreeNode = browser.bookmarks.BookmarkTreeNode;
+
+function Body(props: {tree: BookmarkTreeNode[]}) {
+    const [settingsOpen, setSettingsOpen] = useState(false);
+
+    return (
+        <>
+            <button id="settings-button" onClick={_ => setSettingsOpen(!settingsOpen)}>
+                <img alt="open settings" src={imageUrl}/>
+            </button>
+            {settingsOpen && (<SettingsEditor closer={setSettingsOpen}/>)}
+            <Folder data={
+                (props.tree && props.tree[0] && props.tree[0].children && props.tree[0].children[0])!
+            }/>
+        </>
+    )
+}
+
+export default Body
\ No newline at end of file
-- 
cgit v1.2.3

