Ship first-visit Ant tours for core menus with replay help, role-list search for large orgs, and fixed 32px workspace tabs. Co-authored-by: Cursor <cursoragent@cursor.com>
33 lines
790 B
TypeScript
33 lines
790 B
TypeScript
import { inject, provide, ref, type InjectionKey, type Ref } from 'vue';
|
|
|
|
export type TreasuryChromeOverride = {
|
|
title: string | null;
|
|
};
|
|
|
|
type TreasuryChromeApi = {
|
|
override: Ref<TreasuryChromeOverride>;
|
|
set: (next: TreasuryChromeOverride) => void;
|
|
clear: () => void;
|
|
};
|
|
|
|
const KEY: InjectionKey<TreasuryChromeApi> = Symbol('treasuryPageChrome');
|
|
|
|
export function provideTreasuryPageChrome(): TreasuryChromeApi {
|
|
const override = ref<TreasuryChromeOverride>({ title: null });
|
|
const api: TreasuryChromeApi = {
|
|
override,
|
|
set(next) {
|
|
override.value = next;
|
|
},
|
|
clear() {
|
|
override.value = { title: null };
|
|
},
|
|
};
|
|
provide(KEY, api);
|
|
return api;
|
|
}
|
|
|
|
export function useTreasuryPageChrome(): TreasuryChromeApi | null {
|
|
return inject(KEY, null);
|
|
}
|