Files
framit/app/components/AppFooter.vue

79 lines
2.4 KiB
Vue
Raw Normal View History

2025-11-06 09:24:44 +01:00
<template>
2025-11-11 19:12:21 +01:00
<UFooter class="bg-background-200">
2025-11-06 09:24:44 +01:00
<template #left>
2025-11-11 19:12:21 +01:00
<div class="flex flex-col gap-2">
<p class="text-text-800 text-sm">Copyright &copy; {{ new Date().getFullYear() }}</p>
<p class="text-text-800 text-sm">{{ $t('footer.versions.frontend') }}: {{ version }}</p>
2025-11-19 22:03:35 +01:00
<p class="text-text-800 text-sm">{{ $t('footer.versions.backend') }}: {{ backendVersion }}</p>
2025-11-11 19:12:21 +01:00
</div>
2025-11-06 09:24:44 +01:00
</template>
2025-11-11 19:12:21 +01:00
<UNavigationMenu :items="items" variant="link" :orientation="orientation" />
2025-11-06 09:24:44 +01:00
<template #right>
2026-02-05 12:24:04 +01:00
<FooterSocialAccount
v-for="social in socialAccounts"
:key="social.label"
:icon="social.icon"
:link="social.link"
:label="social.label"
2025-11-06 09:24:44 +01:00
/>
</template>
</UFooter>
</template>
<script setup lang="ts">
import type { NavigationMenuItem } from '@nuxt/ui';
2025-11-11 19:12:21 +01:00
import { version } from '../../package.json';
2026-02-05 12:24:04 +01:00
import type { SocialAccount } from '~/types/social-account';
2025-11-06 09:24:44 +01:00
const toast = useToast();
2025-11-11 19:12:21 +01:00
const { isMobile } = useDevice();
const orientation = computed(() => (isMobile ? 'vertical' : 'horizontal'));
const { getMeta } = useBackend();
2025-11-19 22:03:35 +01:00
const { data, error, loading } = getMeta();
const backendVersion = computed(() =>
loading.value ? 'backend.loading' : data?.value?.version || $t('backend.failed'),
);
2026-02-05 12:24:04 +01:00
const socialAccounts: SocialAccount[] = [
{ icon: 'i-simple-icons-mastodon', label: 'Fediverse', link: 'https://social.phundrak.com/phundrak' },
{ icon: 'i-simple-icons-gitea', label: 'Gitea', link: 'https://labs.phundrak.com/phundrak' },
{ icon: 'i-simple-icons-github', label: 'GitHub', link: 'https://github.com/Phundrak' },
{ icon: 'i-simple-icons-youtube', label: 'YouTube', link: 'https://youtube.com/@phundrak' },
];
2025-11-06 09:24:44 +01:00
const items = computed<NavigationMenuItem[]>(() => [
{
2026-02-05 12:24:04 +01:00
label: $t('footer.links.source.backend'),
to: 'https://labs.phundrak.com/phundrak/bakit',
target: '_blank',
},
{
label: $t('footer.links.source.frontend'),
to: 'https://labs.phundrak.com/phundrak/framit',
target: '_blank',
2025-11-06 09:24:44 +01:00
},
2025-11-11 19:12:21 +01:00
{
label: $t('footer.links.nuxt'),
to: 'https://nuxt.com/',
2026-02-05 12:24:04 +01:00
target: '_blank',
2025-11-11 19:12:21 +01:00
},
{
label: $t('footer.links.rust'),
to: 'https://rust-lang.org/',
2026-02-05 12:24:04 +01:00
target: '_blank',
2025-11-11 19:12:21 +01:00
},
2025-11-06 09:24:44 +01:00
]);
2026-02-05 12:24:04 +01:00
watch(error, (value) => {
if (value) {
toast.add({
title: $t('backend.errors.title'),
description: $t(value.message ?? 'backend.errors.unknown'),
color: 'error',
});
}
});
2025-11-06 09:24:44 +01:00
</script>