mirror of
https://github.com/willchen96/mike.git
synced 2026-07-18 23:11:06 +02:00
Add local repo contents
This commit is contained in:
parent
65739ef1ce
commit
d9690965b5
176 changed files with 68998 additions and 0 deletions
44
frontend/src/app/components/shared/ToolbarTabs.tsx
Normal file
44
frontend/src/app/components/shared/ToolbarTabs.tsx
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import React from "react";
|
||||
|
||||
interface Tab<T extends string> {
|
||||
id: T;
|
||||
label: string;
|
||||
}
|
||||
|
||||
interface Props<T extends string> {
|
||||
tabs: Tab<T>[];
|
||||
active: T;
|
||||
onChange: (id: T) => void;
|
||||
/** Optional content rendered on the right side of the toolbar */
|
||||
actions?: React.ReactNode;
|
||||
}
|
||||
|
||||
export function ToolbarTabs<T extends string>({
|
||||
tabs,
|
||||
active,
|
||||
onChange,
|
||||
actions,
|
||||
}: Props<T>) {
|
||||
return (
|
||||
<div className="flex items-center h-10 px-8 border-b border-gray-200">
|
||||
<div className="flex-1 flex items-center gap-5">
|
||||
{tabs.map((tab) => (
|
||||
<button
|
||||
key={tab.id}
|
||||
onClick={() => onChange(tab.id)}
|
||||
className={`text-xs transition-colors ${
|
||||
active === tab.id
|
||||
? "font-medium text-gray-700"
|
||||
: "font-normal text-gray-500 hover:text-gray-700"
|
||||
}`}
|
||||
>
|
||||
{tab.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
{actions && (
|
||||
<div className="flex items-center gap-1">{actions}</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue