feat: implement media panel with tab navigation

This commit is contained in:
Maze Winther
2025-07-03 20:43:23 +02:00
parent ef0828a13d
commit 59a6c539a1
4 changed files with 500 additions and 389 deletions

View File

@ -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>
);
}