diff options
Diffstat (limited to 'apps/web/src/components/editor/media-panel/tabbar.tsx')
| -rw-r--r-- | apps/web/src/components/editor/media-panel/tabbar.tsx | 29 |
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>
+ );
+}
|
