2021-09-21 11:29:40 +02:00
|
|
|
<template>
|
|
|
|
<div
|
|
|
|
v-if="isDone"
|
|
|
|
class="is-done"
|
|
|
|
:class="{ 'is-done--small': variant === variants.SMALL }"
|
|
|
|
>
|
|
|
|
{{ $t('task.attributes.done') }}
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
const VARIANTS = {
|
|
|
|
DEFAULT: 'default',
|
|
|
|
SMALL: 'small',
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'Done',
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
variants: VARIANTS,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
isDone: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
variant: {
|
|
|
|
type: String,
|
|
|
|
default: VARIANTS.DEFAULT,
|
|
|
|
validator: (variant) => Object.values(VARIANTS).includes(variant),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.is-done {
|
2021-11-22 22:12:54 +01:00
|
|
|
background: var(--success);
|
|
|
|
color: var(--white);
|
2021-09-21 11:29:40 +02:00
|
|
|
padding: .5rem;
|
|
|
|
font-weight: bold;
|
|
|
|
line-height: 1;
|
|
|
|
border-radius: 4px;
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.is-done--small {
|
|
|
|
padding: .2rem .3rem;
|
|
|
|
}
|
|
|
|
</style>
|