All files / apps/developer-portal/layers/workflows/app/components/settings Save.vue

100% Statements 5/5
100% Branches 5/5
100% Functions 2/2
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29  13x             1x           2x                       8x    
<template>
    <div class="flex items-center justify-end gap-3">
        <span v-if="changed" class="text-sm text-muted">{{ $t("settingsSave.unsaved") }}</span>
        <UButton
            :label="$t('settingsSave.discard')"
            color="neutral"
            variant="ghost"
            :disabled="!changed"
            @click="emit('discard')"
        />
        <UButton
            :label="$t('settingsSave.save')"
            :disabled="!changed"
            :loading="saving"
            @click="emit('save')"
        />
    </div>
</template>
 
<script setup lang="ts">
interface Props {
    changed: boolean;
    saving?: boolean;
}
 
const { changed, saving = false } = defineProps<Props>();
const emit = defineEmits<{ save: []; discard: [] }>();
</script>