Simplify and modernize entity components and translations for better performance and consistency

- Replace fragmented name rendering with unified `person.text` in Vue components.
- Migrate `GenderIconRenderBox` to use Bootstrap icons and TypeScript.
- Introduce `GenderTranslation` type and helper for gender rendering.
- Refactor `PersonRenderBox` to streamline rendering logic and improve maintainability. Migrate to typescript
- Update French translations for consistency with new gender rendering.
This commit is contained in:
2025-09-26 14:25:38 +02:00
parent ad2b6d63ac
commit 13b1c45271
7 changed files with 187 additions and 264 deletions

View File

@@ -1,28 +1,28 @@
<template>
<i :class="['fa', genderClass, 'px-1']" />
<i :class="['bi', genderClass]"></i>
</template>
<script setup>
<script setup lang="ts">
import { computed } from "vue";
const props = defineProps({
gender: {
type: Object,
required: true,
},
});
import type { Gender } from "ChillMainAssets/types";
import {toGenderTranslation} from "ChillMainAssets/lib/api/genderHelper";
const genderClass = computed(() => {
switch (props.gender.genderTranslation) {
case "woman":
return "fa-venus";
case "man":
return "fa-mars";
case "both":
return "fa-neuter";
interface GenderIconRenderBoxProps {
gender: Gender;
}
const props = defineProps<GenderIconRenderBoxProps>();
const genderClass = computed<string>(() => {
switch (toGenderTranslation(props.gender)) {
case "female":
return "bi-gender-female";
case "male":
return "bi-gender-male";
case "neutral":
case "unknown":
return "fa-genderless";
default:
return "fa-genderless";
return "bi-gender-neuter";
}
});
</script>