From 6b5f7c8642062906ecb36d905e52d0fcc6172783 Mon Sep 17 00:00:00 2001
From: marios8543 <marios8543@gmail.com>
Date: Thu, 22 Feb 2024 14:07:59 +0200
Subject: Added log viewer as side-tab in settings

---
 frontend/src/components/logviewer/LoggedPlugin.tsx | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 frontend/src/components/logviewer/LoggedPlugin.tsx

(limited to 'frontend/src/components/logviewer/LoggedPlugin.tsx')

diff --git a/frontend/src/components/logviewer/LoggedPlugin.tsx b/frontend/src/components/logviewer/LoggedPlugin.tsx
new file mode 100644
index 00000000..af7564e2
--- /dev/null
+++ b/frontend/src/components/logviewer/LoggedPlugin.tsx
@@ -0,0 +1,35 @@
+import { Focusable } from "decky-frontend-lib";
+import { VFC, useState } from "react";
+import { FaArrowDown, FaArrowUp } from "react-icons/fa";
+import LogList from "./LogList";
+
+interface LoggedPluginProps {
+  plugin: string;
+}
+
+const focusableStyle = {
+  background: "rgba(255,255,255,.15)",
+  borderRadius: "var(--round-radius-size)",
+  padding: "10px 24px",
+  marginBottom: "0.5rem",
+};
+
+const LoggedPlugin: VFC<LoggedPluginProps> = ({ plugin }) => {
+  const [isOpen, setOpen] = useState<boolean>(false);
+
+  return (
+    <div style={focusableStyle}>
+      <Focusable onOKButton={() => setOpen(!isOpen)}>
+        <div style={{ display: "flex", justifyContent: "space-between" }}>
+          <div style={{ flexGrow: 1, textAlign: "left" }}>{plugin}</div>
+          <div style={{ textAlign: "right" }}>
+            {isOpen ? <FaArrowUp /> : <FaArrowDown />}
+          </div>
+        </div>
+      </Focusable>
+      {isOpen && <LogList plugin={plugin} />}
+    </div>
+  );
+};
+
+export default LoggedPlugin;
\ No newline at end of file
-- 
cgit v1.2.3

