<!--
  - Copyright (c) 2022.
  - Author Peter Placzek (tada5hi)
  - For the full copyright and license information,
  - view the LICENSE file that was distributed with this source code.
  -->

<script>
export default {
    props: {
        encrypted: Boolean,
        onlyIcon: {
            type: Boolean,
            default: false
        }
    },
    methods:{
        clicked($event) {
            this.$emit('clicked', $event);
        }
    }
}
</script>

<template>
    <button
        type="button"
        class="btn btn-xs"
        :class="{
            'btn-success': encrypted,
            'btn-warning': !encrypted
        }"
        @click="clicked($event)"
    >
        <template v-if="encrypted">
            <i class="fa fa-lock"></i> <template v-if="!onlyIcon">Verschlüsselt</template>
        </template>
        <template v-else>
            <i class="fa fa-lock-open"></i> <template v-if="!onlyIcon">Unverschlüsselt</template>
        </template>
    </button>
</template>
