init commit

This commit is contained in:
Martin Drechsel
2025-04-02 18:54:55 +02:00
commit 2c5ec6b281
126 changed files with 21323 additions and 0 deletions

View File

@ -0,0 +1,57 @@
import { getSingleRouteParam } from '~/composables/helper';
import type { RouteLocationRaw } from 'vue-router';
export interface IExtensionLink {
name: string;
icon: string;
tooltip?: string;
id: string;
}
export const useExtensionsStore = defineStore('extensionsStore', () => {
const extensions = ref<IExtensionLink[]>([
{
id: 'haex-browser',
name: 'Haex Browser',
icon: 'solar:global-outline',
},
{
id: 'extensions',
name: 'sidebar.extensions',
icon: 'gg:extension',
},
{
id: 'settings',
name: 'sidebar.settings',
icon: 'ph:gear-six',
},
]);
const currentRoute = useRouter().currentRoute.value;
const isActive = (id: string) =>
computed(
() =>
currentRoute.name === 'extension' &&
currentRoute.params.extensionId === id
);
const loadAsync = async (id: string) => {
extensions.value.some(async (extension) => {
if (extension.id === id) {
await navigateTo(
useLocalePath()({ name: 'extension', params: { extensionId: id } })
);
} else {
}
});
};
return {
extensions,
loadAsync,
isActive,
};
});