<template>
  <div>
    <!-- 通訊錄functionBar -->
    <div class="shadow" v-show="$route.name === 'DirectoryInformationList'">
      <b-button
        class="btn1"
        @click="AddNewDirectoryModalOpen = true"
      >
        <b-icon-person-plus-fill></b-icon-person-plus-fill>&ensp;新增聯絡人
      </b-button>

      <b-button
        class="btn1"
        style="background-color:red;"
        @click="DeleteDirectoryModalOpen = true"
      >
        <b-icon-trash-fill></b-icon-trash-fill>&ensp;刪除聯絡人
      </b-button>
    </div>

    <modal
      :isOpen="AddNewDirectoryModalOpen"
      title="新增聯絡人"
      v-on:closeEvent="AddNewDirectoryModalOpen = false"
    >
      <addNewDirectory @closeEvent="AddNewDirectoryModalOpen = false" />
    </modal>

    <modal
      :isOpen="DeleteDirectoryModalOpen"
      title="刪除聯絡人"
      v-on:closeEvent="DeleteDirectoryModalOpen = false"
    >
      <deleteDirectory @closeEvent="DeleteDirectoryModalOpen = false" />
    </modal>

  </div>
</template>

<script>
import addNewDirectory from '@/views/BasicSetting/DirectorySetting/ModalContent/addNewDirectory.vue'
import deleteDirectory from '@/views/BasicSetting/DirectorySetting/ModalContent/deleteDirectory.vue'

export default {
  data () {
    return {
      AddNewDirectoryModalOpen: false,
      DeleteDirectoryModalOpen: false
    }
  },
  methods: {

  },
  components: {
    modal: () => import('@/views/Modal/index.vue'),
    addNewDirectory,
    deleteDirectory
  }
}
</script>

<style scoped>
.shadow {
  background-color: #ffff;
  height: 65px;
  width: 100%;
  box-shadow: 2px 2px 20px rgba(0, 0, 0, 5);
  position: fixed;
  top: 55px;
  z-index: 500;
}
.btn1 {
  background-color: rgb(75, 102, 255);
  font-size: 16px;
  margin-top: 15px;
  margin-left: 15px;
  padding-left: 7px;
  padding-right: 7px;
  padding-top: 5px;
  padding-bottom: 5px;
  color: #ffffff;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
  border: none;
}
.btn1:hover {
  color: rgb(255, 255, 255);
  background-color: rgb(49, 68, 175);
  transform: translateY(0);
}
.btn.btn-secondary[disabled] {
  background-color: rgb(224, 224, 224);
  color: rgb(150, 150, 150);
}
</style>
