11 lines
271 B
TypeScript
11 lines
271 B
TypeScript
export type WorkspaceTab = {
|
|
key: string;
|
|
title: string;
|
|
route: string;
|
|
};
|
|
|
|
export function openTab(existing: WorkspaceTab[], next: WorkspaceTab): WorkspaceTab[] {
|
|
if (existing.some((tab) => tab.key === next.key)) return existing;
|
|
return [...existing, next];
|
|
}
|