mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-04-29 15:04:42 +00:00
24 lines
516 B
TypeScript
24 lines
516 B
TypeScript
import { ref } from 'vue';
|
|
import type { RouteLocationRaw } from 'vue-router';
|
|
|
|
import type { IconNames } from '~/components/atomic/Icon.vue';
|
|
|
|
import { inject, provide } from './useInjectProvide';
|
|
|
|
export interface Tab {
|
|
to: RouteLocationRaw;
|
|
title: string;
|
|
icon?: IconNames;
|
|
iconClass?: string;
|
|
matchChildren?: boolean;
|
|
}
|
|
|
|
export function useTabsProvider() {
|
|
const tabs = ref<Tab[]>([]);
|
|
provide('tabs', tabs);
|
|
}
|
|
|
|
export function useTabsClient() {
|
|
const tabs = inject('tabs');
|
|
return { tabs };
|
|
}
|