<template>
  <Panel class="vtj-schema" :title="null" :body-padding="true">
    <CodeEditor
      lang="json"
      height="100%"
      :dark="false"
      readonly
      :model-value="schema"></CodeEditor>
  </Panel>
</template>
<script lang="ts" setup>
import { Panel, useCore } from '@vtj/engine';
import CodeEditor from '../parts/CodeEditor.vue';
import { computed } from 'vue';
const { project } = useCore();

const schema = computed(() => {
  if (project.current) {
    return JSON.stringify(project.current.toSchema(), null, 2);
  }
  return '';
});
</script>
