import { defineComponent, inject, Ref, watch } from 'vue';

const Main = defineComponent({
  setup(props, { slots }) {
    const mainMounted = inject<Ref<boolean>>('tl-mainMounted')!;
    // 通知父组件这个插件被挂载
    mainMounted.value = true;

    const drawer = inject<Ref<boolean>>('tl-drawer')!;

    return () => (
      <div
        class={`table-layout__main flex flex-col h-full ${
          drawer.value ? 'flex-1' : ''
        }`}
      >
        {slots.default?.()}
      </div>
    );
  }
});

export { Main };
