From 34265613b80d1d2249d276da5fcd5e4c274af357 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Tue, 14 May 2024 12:16:04 +0700 Subject: feat(ui): add history explore (#2022) * break out HistoryRow, add drawer * syntax highlighting! * smaller text * allow inspecting all old commands, no drag command * fix query bug * add loader --- ui/src/components/history/HistoryInspect.tsx | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 ui/src/components/history/HistoryInspect.tsx (limited to 'ui/src/components/history/HistoryInspect.tsx') diff --git a/ui/src/components/history/HistoryInspect.tsx b/ui/src/components/history/HistoryInspect.tsx new file mode 100644 index 00000000..8e820169 --- /dev/null +++ b/ui/src/components/history/HistoryInspect.tsx @@ -0,0 +1,40 @@ +import { useState, useEffect } from "react"; + +import PacmanLoader from "react-spinners/PacmanLoader"; + +import CodeBlock from "@/components/CodeBlock"; +import HistoryRow from "@/components/history/HistoryRow"; +import { inspectCommandHistory } from "@/state/models"; + +function renderLoading() { + return ( +
+ +
+ ); +} + +export default function HistoryInspect({ history }: any) { + let [other, setOther] = useState([]); + + useEffect(() => { + (async () => { + let inspect = await inspectCommandHistory(history); + setOther(inspect.other); + })(); + }, []); + + if (other.length == 0) return renderLoading(); + + return ( +
+ + +
+ {other.map((i: any) => { + return ; + })} +
+
+ ); +} -- cgit v1.3.1