mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
- Move stores/utils/types to their relative directories (i.e chat stores in chat directory) - Move utility files to shared/utils - Move component files to shared/components - Move type definitions to shared/types - Move stores to shared/stores - Update import paths across the project
33 lines
767 B
TypeScript
33 lines
767 B
TypeScript
import { create } from 'zustand';
|
|
|
|
export interface TabConfig {
|
|
id: string;
|
|
visible: boolean;
|
|
window: 'developer' | 'user';
|
|
order: number;
|
|
locked?: boolean;
|
|
}
|
|
|
|
interface TabConfigurationStore {
|
|
userTabs: TabConfig[];
|
|
developerTabs: TabConfig[];
|
|
get: () => { userTabs: TabConfig[]; developerTabs: TabConfig[] };
|
|
set: (config: { userTabs: TabConfig[]; developerTabs: TabConfig[] }) => void;
|
|
reset: () => void;
|
|
}
|
|
|
|
const DEFAULT_CONFIG = {
|
|
userTabs: [],
|
|
developerTabs: [],
|
|
};
|
|
|
|
export const tabConfigurationStore = create<TabConfigurationStore>((set, get) => ({
|
|
...DEFAULT_CONFIG,
|
|
get: () => ({
|
|
userTabs: get().userTabs,
|
|
developerTabs: get().developerTabs,
|
|
}),
|
|
set: (config) => set(config),
|
|
reset: () => set(DEFAULT_CONFIG),
|
|
}));
|