import { inject, provide } from 'vue';
import type { FormInst } from 'naive-ui';

const key = Symbol('formElRef');

export function createFormContext(instance: FormInst) {
  provide(key, instance);
}

export function useFormContext() {
  return inject(key);
}
