<template>
  <ShapeComponent
    :data="(item as any)"
    v-for="item in tempItems"
    temp
    :key="item.id"
    :real="store.getItemById(item.id)"
    addMode
  />
</template>

<script setup lang="ts">
import { ShapeType, components } from "../components";
import { useInteractiveAdd } from "../hook/use-draw.ts";
import { useStore } from "../store/index.ts";

const props = defineProps<{ type: ShapeType }>();
const tempItems = useInteractiveAdd(props.type);
const type = props.type;
const ShapeComponent = components[type].TempComponent || components[type].Component;
const store = useStore();
</script>
