<template>
  <v-row
    class="flex-column flex-nowrap"
    :class="{ isModal }"
    no-gutters
  >
    <v-row
      class="pa-1 mt-3 mb-3 pl-4"
      no-gutters
      v-for="(segment, idx) in measurement.SegmentLengths"
    >
      <v-col class="text-xs-semibold">
        <span>{{ t('labels.segment') }}&nbsp;</span>
        <span>{{ idx + 1 }}</span>
      </v-col>
      <v-col class="text-mono text-right text-xs-regular pr-4">
        <span>{{ segment }}</span>
        <span>{{ measurement.Units }}</span>
      </v-col>
    </v-row>
    <v-row
      class="flex-nowrap px-1 pl-4 pb-3"
      no-gutters
    >
      <v-col class="text-xs-semibold">
        <span>{{ t('labels.totalLength') }}</span>
      </v-col>
      <v-col class="text-mono text-right text-xs-regular pr-4">
        <span>{{ measurement.TotalLength }}</span>
        <span>{{ measurement.Units }}</span>
      </v-col>
    </v-row>
  </v-row>
</template>

<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { DataOverlayLength } from '@3cr/viewer-types-ts';

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

defineProps<Props>();

const { t } = useI18n();
</script>
