<template>
  <template v-if="isDataOverlayLength(measurement)">
    <measurement-info-length :measurement="measurement" :is-modal="isModal" />
  </template>
  <template v-else-if="isDataOverlayPolygon(measurement)">
    <measurement-info-polygon :measurement="measurement" :is-modal="isModal" />
  </template>
  <template v-else-if="isDataOverlayAngle(measurement)">
    <measurement-info-angle :measurement="measurement" :is-modal="isModal" />
  </template>
</template>

<script setup lang="ts">
import { isDataOverlayLength } from '@/functions/guards/isDataOverlayLength';
import { isDataOverlayPolygon } from '@/functions/guards/isDataOverlayPolygon';
import { isDataOverlayAngle } from '@/functions/guards/isDataOverlayAngle';
import { DataOverlayMeasurement } from '@3cr/viewer-types-ts';

interface Props {
  measurement: DataOverlayMeasurement;
  isModal: boolean;
}

defineProps<Props>();
</script>
