<template>
  <div class="alarm-overlay">
    <Alarm
      v-if="pageType == 1"
      :data="alarmData"
      @close="$emit('close')"
    />
    <emergency
      v-if="pageType == 2"
      :alarmData="alarmData"
      @close="$emit('close')"
    />
  </div>
</template>

<script>
import Alarm from './alarm.vue'
import emergency from './emergency.vue'

export default {
  name: 'AlarmWindow',
  components: { Alarm,emergency },
  props: {
    alarmData: {
      type: Object,
      default: () => ({})
    }
  },
  data(){
    return{
      pageType:1,
    }
  },
  methods: {
    emergencyButton(val){
      this.$set(this,'pageType',val);
    },
  }
}
</script>

<style lang="scss" scoped>
.alarm-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}
</style>
