adrema/resources/js/components/ui/BooleanDisplay.vue

33 lines
1003 B
Vue
Raw Permalink Normal View History

2022-11-22 00:37:34 +01:00
<template>
<div v-tooltip="longLabel" class="flex space-x-2 items-center">
2023-09-12 16:54:13 +02:00
<div class="border-2 rounded-full w-5 h-5 flex items-center justify-center" :class="value ? (dark ? 'border-green-500' : 'border-green-700') : dark ? 'border-red-500' : 'border-red-700'">
<ui-sprite :src="value ? 'check' : 'close'" :class="value ? (dark ? 'text-green-600' : 'text-green-800') : dark ? 'text-red-600' : 'text-red-800'" class="w-3 h-3 flex-none"></ui-sprite>
2022-11-22 00:37:34 +01:00
</div>
<div class="text-gray-400 text-xs" v-text="label"></div>
</div>
</template>
<script>
export default {
props: {
value: {
required: true,
type: Boolean,
},
label: {
type: String,
2023-09-12 16:54:13 +02:00
default: () => '',
2022-11-22 00:37:34 +01:00
},
longLabel: {
default: function () {
return null;
},
},
2023-09-05 16:29:22 +02:00
dark: {
type: Boolean,
default: () => false,
},
2022-11-22 00:37:34 +01:00
},
};
</script>