<script setup lang="ts">
import { EditorService } from '@core/editor.service';
import { onMounted, provide, shallowRef } from 'vue';

const EDITOR_KEY = Symbol('editor-key');

type Props = {
  id: string;
};
const props = defineProps<Props>();

const container = shallowRef<HTMLDivElement>();
const editor = shallowRef<EditorService>();
provide(EDITOR_KEY, editor);
onMounted(() => {
  editor.value = new EditorService(container.value!);
});
</script>

<template>
  <a-layout class="full">
    <a-layout-header>header</a-layout-header>

    <a-layout>
      <a-layout-sider>
        <RobotList v-if="editor" :editor="EDITOR_KEY" />
      </a-layout-sider>
      <a-layout-content>
        <div ref="container" class="full"></div>
      </a-layout-content>
      <a-layout-sider>{{ $t('查询') }}</a-layout-sider>
    </a-layout>
  </a-layout>
</template>

<!-- <style scoped lang="scss"></style> -->
