mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-06 20:37:44 +00:00
36 lines
645 B
TypeScript
36 lines
645 B
TypeScript
import { CodeTab } from "./code-tabs";
|
|
|
|
interface File {
|
|
id: string;
|
|
name: string;
|
|
content: string;
|
|
}
|
|
|
|
interface TabBarProps {
|
|
files: File[];
|
|
activeFileId: string;
|
|
onTabClick: (fileId: string) => void;
|
|
onTabClose: (fileId: string) => void;
|
|
}
|
|
|
|
export function TabBar({
|
|
files,
|
|
activeFileId,
|
|
onTabClick,
|
|
onTabClose,
|
|
}: TabBarProps) {
|
|
return (
|
|
<div className="flex bg-muted border-b border-border">
|
|
{files.map((file) => (
|
|
<CodeTab
|
|
key={file.id}
|
|
fileName={file.name}
|
|
isActive={file.id === activeFileId}
|
|
onClick={() => onTabClick(file.id)}
|
|
onClose={() => onTabClose(file.id)}
|
|
/>
|
|
))}
|
|
</div>
|
|
);
|
|
}
|