<script setup lang="ts">
import { NFlex } from 'naive-ui';
import { DeviceCommonCard, DeviceHeaderCard } from '@/components';
import type { NdmAlarmHostResultVO, Station } from '@/apis';
import { computed, toRefs } from 'vue';

const props = defineProps<{
  ndmDevice: NdmAlarmHostResultVO;
  station: Station;
}>();

const { ndmDevice, station } = toRefs(props);

const commonInfo = computed(() => {
  const { createdTime, updatedTime, manufacturer } = ndmDevice.value;
  return {
    创建时间: createdTime ?? '-',
    更新时间: updatedTime ?? '-',
    制造商: manufacturer ?? '-',
  };
});
</script>

<template>
  <NFlex vertical>
    <DeviceHeaderCard :ndm-device="ndmDevice" :station="station" />
    <DeviceCommonCard :common-info="commonInfo" />
  </NFlex>
</template>

<style scoped lang="scss"></style>
