<template>
  <div class="ButtonsBlock" v-if="selected.length">
    <div
      v-if="
        $AC.haveOneOfScope([
          $AC.scopes.MILITARY_RECRUIT_SPECIALIST,
          $AC.scopes.SYSTEM_ADMINISTRATOR,
        ])
      "
      class="DopButton"
    >
      <div class="row flex items-center q-gutter-xs">
        <div class="q-pr-sm">
          <span class="DopButton-TextFiled"> Выбрано: </span>
          <span class="DopButton-TextField DopButton-TextFiled__Bold">
            {{ selected.length }}
          </span>
        </div>
        <multi-confirm
          class="DopButton-Button"
          label="Подтвердить"
          title="Подтверждение"
          process-key="milBaseRouteProcess"
          action-type="confirmRecruit"
          :model="selected"
          @done="onReload"
        />
        <multi-not-confirm
          label="Отклонить"
          title="Отклонить"
          process-key="milBaseRouteProcess"
          action-type="notConfirmRecruit"
          :model="selected"
          @done="onReload"
        />
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
import MultiConfirm from '@/recruits/components/dialogs/MultiConfirm.vue';
import MultiNotConfirm from '@/recruits/components/dialogs/MultiNotConfirm.vue';
import { formatDate } from '@/recruits/utils';

@Component({
  components: {
    MultiConfirm,
    MultiNotConfirm,
  },
})
export default class ListButtons extends Vue {
  @Prop({ default: () => [] }) private selected: string[];
  @Prop() data: any;

  public onReload(): void {
    this.$emit('onReload');
  }
}
</script>

<style lang="scss">
.ButtonsBlock {
  display: flex;
  flex-flow: row;
  align-items: flex-start;
  gap: 16px;
}
.DopButton {
  box-sizing: border-box;
  background-color: rgba(15, 32, 160, 0.08);
  border-radius: 20px;
  padding: 4px;
  margin-top: -5px;
  margin-bottom: -5px;
  &-TextFiled {
    margin-left: 8px;
    margin-right: 8px;
    font-family: 'Golos UI', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 16px;
    color: rgba(2, 12, 18, 0.58);
    &__Bold {
      font-weight: 500;
      color: #015e98;
    }
  }
  &-Button {
    &__Color {
      &__DarkBlue {
        background: linear-gradient(92.91deg, #1491cf 0%, #0f68a0 100%);
        box-shadow: 0 0.6px 1.8px rgba(7, 46, 71, 0.12),
          0 3.2px 8px rgba(7, 46, 71, 0.15);
        color: rgba(255, 255, 255, 0.92);
      }
    }
  }
}
</style>
