refactor: address some review comments

This commit is contained in:
Adaline Simonian 2025-01-16 11:17:04 -08:00
parent c5ec0603c8
commit 75179eed26
No known key found for this signature in database

View File

@ -1,4 +1,6 @@
<script setup lang="ts">
import { clearUrl } from '../src/helpers.ts';
const { $locales: locales, $t } = useNuxtApp();
const config = useConfig();
const route = useRoute();
@ -28,9 +30,10 @@ const returnPath = getSanitizedReturnPath();
const options = (config.macrolanguage?.languages || []).map(({ code }) => ({
key: code,
text: locales[code]?.fullName || code,
name: locales[code]?.name,
extra: locales[code]?.extra,
url: `${locales[code]?.url}${returnPath}`,
domain: locales[code]?.url,
domain: clearUrl(locales[code]?.url || ''),
}));
</script>
@ -50,7 +53,10 @@ const options = (config.macrolanguage?.languages || []).map(({ code }) => ({
class="list-group-item list-group-item-action"
>
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">{{ option.text }}</h5>
<h5 class="mb-1">
{{ option.name }}
<small v-if="option.extra">({{ option.extra }})</small>
</h5>
</div>
<p class="mb-1">{{ option.domain }}</p>
</a>