Files
homebox/frontend/components/global/Currency.vue
Tonya d4e28e6f3b Upgrade frontend deps, including nuxt (#982)
* feat: begin upgrading deps, still very buggy

* feat: progress

* feat: sort all type issues

* fix: sort type issues

* fix: import sonner styles

* fix: nuxt is the enemy

* fix: try sorting issue with workflows

* fix: update vitest config for dynamic import of path and defineConfig

* fix: add missing import

* fix: add time out to try and fix issues

* fix: add ui:ci:preview task for frontend build in CI mode

* fix: i was silly

* feat: add go:ci:with-frontend task for CI mode and remove ui:ci:preview from e2e workflow

* fix: update baseURL in Playwright config for local testing to use port 7745

* fix: update E2E_BASE_URL and remove wait for timeout in login test for smoother execution
2025-09-04 09:00:25 +01:00

44 lines
920 B
Vue

<template>
<Suspense>
<template #default>
{{ formattedValue }}
</template>
<template #fallback> {{ $t("global.loading") }} </template>
</Suspense>
</template>
<script setup lang="ts">
import { computed, ref } from "vue";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
type Props = {
amount: string | number;
};
const props = defineProps<Props>();
type AsyncReturnType<T extends (...args: unknown[]) => unknown> = Awaited<ReturnType<T>>;
const fmt = ref<AsyncReturnType<typeof useFormatCurrency> | null>(null);
const loadFormatter = async () => {
fmt.value = await useFormatCurrency();
};
loadFormatter();
const formattedValue = computed(() => {
if (!fmt.value) {
return t("global.loading");
}
if (!props.amount || props.amount === "0") {
return fmt.value(0);
}
return fmt.value(props.amount);
});
</script>