<template>
  <div>
    <q-btn
      unelevated
      style="color: rgba(0, 0, 0, 0.54)"
      icon="attach_file"
      text-color="primary"
    >
      <q-popup-proxy>
        <attachment-editor
          :attachments="attachments"
          schema="Interagency"
          :id="interagencyId"
          :extensions="extensions"
          :multiple="multiple"
          @setAttachments="setAttachments"
        />
      </q-popup-proxy>
      <q-tooltip :delay="500">Вложения</q-tooltip>
    </q-btn>
  </div>
</template>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';

@Component
export default class InteragencyAttachmentsBtn extends Vue {
  @Prop({ required: true }) interagencyId: string;
  @Prop() attachments: any[];
  @Prop() extensions: string;
  @Prop() multiple: boolean;

  setAttachments(data: any[]) {
    this.$emit('set-attachments', data);
  }
}
</script>

<style scoped></style>