mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2026-01-01 18:47:20 +01:00
* 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
44 lines
920 B
Vue
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>
|