summaryrefslogtreecommitdiff
path: root/apps/web/src/components/editor/media-panel/tabbar.tsx
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2025-07-03 20:43:23 +0200
committerMaze Winther <mazewinther@gmail.com>2025-07-03 20:43:23 +0200
commit59a6c539a150adf9ff9ed3d91854b2bea6e7c517 (patch)
tree6e3d5f2e5cad95d314709ff19991d14f557514a6 /apps/web/src/components/editor/media-panel/tabbar.tsx
parentef0828a13d6160eaa9e72b7f00350d9cfaa388e1 (diff)
downloadopencut-59a6c539a150adf9ff9ed3d91854b2bea6e7c517.tar.gz
feat: implement media panel with tab navigation
Diffstat (limited to 'apps/web/src/components/editor/media-panel/tabbar.tsx')
-rw-r--r--apps/web/src/components/editor/media-panel/tabbar.tsx29
1 files changed, 29 insertions, 0 deletions
diff --git a/apps/web/src/components/editor/media-panel/tabbar.tsx b/apps/web/src/components/editor/media-panel/tabbar.tsx
new file mode 100644
index 00000000..90f8a70d
--- /dev/null
+++ b/apps/web/src/components/editor/media-panel/tabbar.tsx
@@ -0,0 +1,29 @@
+"use client";
+
+import { cn } from "@/lib/utils";
+import { Tab, tabs, useMediaPanelStore } from "./store";
+
+export function TabBar() {
+ const { activeTab, setActiveTab } = useMediaPanelStore();
+
+ return (
+ <div className="h-12 bg-accent/50 px-3 flex justify-start items-center gap-6">
+ {(Object.keys(tabs) as Tab[]).map((tabKey) => {
+ const tab = tabs[tabKey];
+ return (
+ <div
+ className={cn(
+ "flex flex-col gap-0.5 items-center cursor-pointer",
+ activeTab === tabKey ? "text-primary" : "text-muted-foreground"
+ )}
+ onClick={() => setActiveTab(tabKey)}
+ key={tabKey}
+ >
+ <tab.icon className="!size-5" />
+ <span className="text-[0.65rem]">{tab.label}</span>
+ </div>
+ );
+ })}
+ </div>
+ );
+}