feat: add svelte web workspace shell
This commit is contained in:
10
apps/web/src/app/tabs.ts
Normal file
10
apps/web/src/app/tabs.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
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];
|
||||
}
|
||||
Reference in New Issue
Block a user