import { inject, provide, type InjectionKey, type Ref } from "vue";

export const formSlugBaseKey: InjectionKey<Ref<string>> =
  Symbol("formSlugBase");

export function provideFormSlugBase(slugBase: Ref<string>): void {
  provide(formSlugBaseKey, slugBase);
}

export function useFormSlugBase(): Ref<string> | null {
  return inject(formSlugBaseKey, null);
}
