+
+ setQuery(e.target.value)}
+ />
+
+
+
+
+ {filtered.length} command{filtered.length === 1 ? "" : "s"}
+ {filtered.length > RESULT_CAP ? ` — showing first ${RESULT_CAP}, refine your search` : ""}
+
+ {shown.map((cmd) => (
+
+
+ {openName === cmd.name && }
+
+ ))}
+
+ );
+}
diff --git a/src/tabs/DatabaseTab.tsx b/src/tabs/DatabaseTab.tsx
new file mode 100644
index 0000000..eae7828
--- /dev/null
+++ b/src/tabs/DatabaseTab.tsx
@@ -0,0 +1,81 @@
+import { useMemo, useState } from "react";
+import type { DbEntry, TemplateParam } from "../types";
+import { matches } from "../lib/commands";
+import { CommandRow } from "../components/CopyButton";
+import { ParamFields, defaultValues } from "../components/ParamFields";
+
+const RESULT_CAP = 150;
+
+export interface BuiltCommand {
+ label: string;
+ command: string;
+}
+
+interface Props {
+ entries: DbEntry[];
+ placeholder: string;
+ params: TemplateParam[];
+ /** Builds the copyable command variants for one entry. */
+ build: (entry: DbEntry, values: Record