import { useResource } from "@/modules/resource";
import { Empty } from "ant-design-vue";
import { defineUI } from "queenjs";
import MatAttr from "./MatAttr";
import MeshAttr from "./MeshAttr";

export default defineUI({
  setup() {
    const resource = useResource();
    
    return () => {
      const { activeKeys } = resource.store;
      if (!resource.store.currentSlot)
        return <Empty class="pt-80px" description="暂无数据" />;
      else if (activeKeys.type == "mat") {
        const data = resource.store.currentSlot.material;
        return <MatAttr data={data} />;
      } else if (activeKeys.type == "mesh") {
        return <MeshAttr data={{}} />;
      }
    };
  },
});
