From 808138de633e410c1d3867d4fb7cb74967647605 Mon Sep 17 00:00:00 2001
From: Ellie Huxtable <ellie@atuin.sh>
Date: Tue, 30 Jul 2024 16:54:10 +0100
Subject: chore: remove ui directory (#2329)

This is still in development, but rather than clutter the commit history
and issues with an unreleased project I've split the UI into its own
repo.

Once ready for release, I'll either merge the ui code back in, or just
make the repo public.
---
 ui/src/components/runbooks/List.tsx | 141 ------------------------------------
 1 file changed, 141 deletions(-)
 delete mode 100644 ui/src/components/runbooks/List.tsx

(limited to 'ui/src/components/runbooks/List.tsx')

diff --git a/ui/src/components/runbooks/List.tsx b/ui/src/components/runbooks/List.tsx
deleted file mode 100644
index 42da3885..00000000
--- a/ui/src/components/runbooks/List.tsx
+++ /dev/null
@@ -1,141 +0,0 @@
-import { useEffect } from "react";
-import {
-  Button,
-  ButtonGroup,
-  Tooltip,
-  Listbox,
-  ListboxItem,
-  Dropdown,
-  DropdownTrigger,
-  DropdownMenu,
-  DropdownItem,
-  Badge,
-} from "@nextui-org/react";
-
-import { EllipsisVerticalIcon } from "lucide-react";
-
-import { DateTime } from "luxon";
-
-import { NotebookPenIcon } from "lucide-react";
-import Runbook from "@/state/runbooks/runbook";
-import { AtuinState, useStore } from "@/state/store";
-
-const NoteSidebar = () => {
-  const runbooks = useStore((state: AtuinState) => state.runbooks);
-  const refreshRunbooks = useStore(
-    (state: AtuinState) => state.refreshRunbooks,
-  );
-
-  const currentRunbook = useStore((state: AtuinState) => state.currentRunbook);
-  const setCurrentRunbook = useStore(
-    (state: AtuinState) => state.setCurrentRunbook,
-  );
-  const runbookInfo = useStore((state: AtuinState) => state.runbookInfo);
-
-  useEffect(() => {
-    refreshRunbooks();
-  }, []);
-
-  return (
-    <div className="w-48 flex flex-col border-r-1">
-      <div className="overflow-y-auto flex-grow">
-        <Listbox
-          hideSelectedIcon
-          items={runbooks.map((runbook: any): any => {
-            return [runbook, runbookInfo[runbook.id]];
-          })}
-          variant="flat"
-          aria-label="Runbook list"
-          selectionMode="single"
-          selectedKeys={currentRunbook ? [currentRunbook] : []}
-          itemClasses={{ base: "data-[selected=true]:bg-gray-200" }}
-          topContent={
-            <ButtonGroup className="z-20">
-              <Tooltip showArrow content="New Runbook" closeDelay={50}>
-                <Button
-                  isIconOnly
-                  aria-label="New note"
-                  variant="light"
-                  size="sm"
-                  onPress={async () => {
-                    // otherwise the cursor is weirdly positioned in the new document
-                    window.getSelection()?.removeAllRanges();
-
-                    let runbook = await Runbook.create();
-                    setCurrentRunbook(runbook.id);
-                    refreshRunbooks();
-                  }}
-                >
-                  <NotebookPenIcon className="p-[0.15rem]" />
-                </Button>
-              </Tooltip>
-            </ButtonGroup>
-          }
-        >
-          {([runbook, info]: [Runbook, { ptys: number }]) => (
-            <ListboxItem
-              key={runbook.id}
-              onPress={() => {
-                setCurrentRunbook(runbook.id);
-              }}
-              textValue={runbook.name || "Untitled"}
-              endContent={
-                <Dropdown>
-                  <Badge
-                    content={info?.ptys}
-                    color="primary"
-                    style={
-                      info && info?.ptys > 0
-                        ? {}
-                        : {
-                            display: "none",
-                          }
-                    }
-                  >
-                    <DropdownTrigger className="bg-transparent">
-                      <Button isIconOnly>
-                        <EllipsisVerticalIcon
-                          size="16px"
-                          className="bg-transparent"
-                        />
-                      </Button>
-                    </DropdownTrigger>
-                  </Badge>
-                  <DropdownMenu aria-label="Dynamic Actions">
-                    <DropdownItem
-                      key={"delete"}
-                      color="danger"
-                      className="text-danger"
-                      onPress={async () => {
-                        await Runbook.delete(runbook.id);
-
-                        if (runbook.id == currentRunbook) setCurrentRunbook("");
-
-                        refreshRunbooks();
-                      }}
-                    >
-                      Delete
-                    </DropdownItem>
-                  </DropdownMenu>
-                </Dropdown>
-              }
-            >
-              <div className="flex flex-col">
-                <div className="text-md">{runbook.name || "Untitled"}</div>
-                <div className="text-xs text-gray-500">
-                  <em>
-                    {DateTime.fromJSDate(runbook.updated).toLocaleString(
-                      DateTime.DATETIME_SHORT,
-                    )}
-                  </em>
-                </div>
-              </div>
-            </ListboxItem>
-          )}
-        </Listbox>
-      </div>
-    </div>
-  );
-};
-
-export default NoteSidebar;
-- 
cgit v1.3.1

