This repository has been archived on 2025-10-03. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
rebuilding-uis/src/components/DrupalMessage.vue

31 lines
912 B
Vue
Raw Normal View History

2018-12-28 01:11:39 +00:00
<template>
<div :class="[ wrapperClasses, wrapperClasses ? 'pl-2 rounded-sm' : '' ]">
<div class="py-4 pl-3 pr-4 mb-4 border flex items-center rounded-sm" :class="classes">
2019-03-10 00:31:37 +00:00
<svg v-if="type == 'status'" class="fill-current w-4 h-4 text-green-30 mr-3" xmlns="http://www.w3.org/2000/svg"><path d="M6.464 13.676a.502.502 0 0 1-.707 0L.797 8.721a.502.502 0 0 1 0-.707l1.405-1.407a.5.5 0 0 1 .707 0l2.849 2.848a.504.504 0 0 0 .707 0l6.629-6.626a.502.502 0 0 1 .707 0l1.404 1.404a.504.504 0 0 1 0 .707l-8.741 8.736z"/></svg>
2018-12-28 13:56:14 +00:00
<slot></slot>
2018-12-28 01:11:39 +00:00
</div>
</div>
</template>
2018-12-28 13:56:14 +00:00
<script>
export default {
props: {
type: String,
},
computed: {
classes: function () {
return {
2019-03-10 00:31:37 +00:00
status: 'border-green-20 text-green-40 bg-green-10',
}[this.type]
},
wrapperClasses: function () {
return {
2019-03-10 00:31:37 +00:00
status: 'bg-green-30',
}[this.type]
},
}
2018-12-28 13:56:14 +00:00
}
</script>