diff --git a/src/components/tabs.tsx b/src/components/tabs.tsx
new file mode 100644
index 0000000..031e992
--- /dev/null
+++ b/src/components/tabs.tsx
@@ -0,0 +1,16 @@
+interface Tab {
+ label: string;
+ value: string;
+}
+
+export default function Tabs({ tabs, activeTab }: { tabs: Tab[], activeTab: string }) {
+ return (
+
+ {tabs.map((tab) => (
+
+ {tab.label}
+
+ ))}
+
+ );
+}
\ No newline at end of file
diff --git a/src/constants.ts b/src/constants.ts
new file mode 100644
index 0000000..64c88e8
--- /dev/null
+++ b/src/constants.ts
@@ -0,0 +1,19 @@
+export const VIEWS = [
+ "home",
+ "single-worker",
+ "single-r2-bucket",
+ "single-d1-database",
+ "single-queue",
+];
+
+export const PANELS = [
+ "workers",
+ "durables",
+ "buckets",
+ "domains",
+ "queues",
+ "d1",
+ "kv",
+];
+
+export const WORKER_TABS = ["events", "deployments"] as const;
\ No newline at end of file
diff --git a/src/index.tsx b/src/index.tsx
index 5dc9205..76a67ba 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -32,6 +32,7 @@ import SingleD1DatabaseView from "./views/d1/single";
import SingleQueueView from "./views/queues/single";
import { CheckForUpdate } from "./components/utils/check-for-update";
import type { Namespace } from "cloudflare/src/resources/kv.js";
+import { PANELS, WORKER_TABS } from "./constants";
const { values, positionals } = parseArgs({
args: Bun.argv,
@@ -67,24 +68,6 @@ if (positionals.length == 2) {
// user has just called cftop
function App() {
- const views = [
- "home",
- "single-worker",
- "single-r2-bucket",
- "single-d1-database",
- "single-queue",
- ];
-
- const panels = [
- "workers",
- "durables",
- "buckets",
- "domains",
- "queues",
- "d1",
- "kv",
- ];
-
const renderer = useRenderer();
const [view, setView] = useState("home");
const [workers, setWorkers] = useState