2026-01-02 13:41:09 +00:00
|
|
|
<!-- Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/ -->
|
2022-08-31 11:19:01 +00:00
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { computed } from 'vue'
|
2024-05-17 13:31:19 +00:00
|
|
|
|
2023-04-24 12:50:55 +00:00
|
|
|
import type { ObjectAttributeBoolean } from './attributeBooleanTypes.ts'
|
2024-12-12 09:24:27 +00:00
|
|
|
import type { ObjectAttributeProps } from '../../types.ts'
|
2022-08-31 11:19:01 +00:00
|
|
|
|
2025-06-11 17:45:28 +00:00
|
|
|
const props = defineProps<ObjectAttributeProps<ObjectAttributeBoolean, boolean>>()
|
2022-08-31 11:19:01 +00:00
|
|
|
|
|
|
|
|
const body = computed(() => {
|
|
|
|
|
const { true: yes, false: no } = props.attribute.dataOption?.options || {}
|
|
|
|
|
return props.value ? yes || __('yes') : no || __('no')
|
|
|
|
|
})
|
2022-10-06 08:29:24 +00:00
|
|
|
|
|
|
|
|
const translate = computed(() => {
|
|
|
|
|
const { translate = true } = props.attribute.dataOption || {}
|
|
|
|
|
return translate
|
|
|
|
|
})
|
2022-08-31 11:19:01 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2022-10-06 08:29:24 +00:00
|
|
|
{{ translate ? $t(body) : body }}
|
2022-08-31 11:19:01 +00:00
|
|
|
</template>
|