Files
haex-hub-mirror/src/stores/ui/sidebar.ts
2025-05-15 09:28:45 +02:00

48 lines
1010 B
TypeScript

import type { RouteLocationAsRelativeGeneric } from "vue-router";
export interface ISidebarItem {
name: string;
icon: string;
tooltip?: string;
id: string;
to?: RouteLocationAsRelativeGeneric;
iconType?: "icon" | "svg";
}
export const useSidebarStore = defineStore("sidebarStore", () => {
const isVisible = ref(true);
const menu = ref<ISidebarItem[]>([
{
id: "haex-browser",
name: "Haex Browser",
icon: "solar:global-outline",
to: { name: "haexBrowser" },
},
{
id: "haex-extensions-add",
name: "Haex Extensions",
icon: "gg:extension",
to: { name: "extensionOverview" },
},
]);
/* const loadAsync = async (id: string) => {
extensions.value.some(async (extension) => {
if (extension.id === id) {
await navigateTo(
useLocalePath()({ name: 'extension', params: { extensionId: id } })
);
} else {
}
});
}; */
return {
menu,
isVisible,
//loadAsync,
};
});