frontend/app/components/sidebars/footer/footer-actions.vue

85 lines
2.9 KiB
Vue
Raw Normal View History

<script setup lang="ts">
import {
ChevronsUpDown,
Cog,
DownloadCloud,
Pen,
UserPlus,
} from "lucide-vue-next";
import TinyCard from "~/components/profiles/tiny-card.vue";
import { Button } from "~/components/ui/button";
import {
SidebarFooter,
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem,
} from "~/components/ui/sidebar";
2025-07-16 07:48:39 +02:00
import * as m from "~~/paraglide/messages.js";
import AccountManager from "../account/account-manager.vue";
2025-06-26 22:39:02 +02:00
const { $pwa } = useNuxtApp();
const authStore = useAuthStore();
</script>
<template>
<SidebarFooter>
<SidebarMenu class="gap-3">
<SidebarMenuItem>
<AccountManager>
2025-12-09 22:32:22 +01:00
<SidebarMenuButton
v-if="authStore.account && authStore.instance"
size="lg"
>
<TinyCard
:account="authStore.account"
:domain="authStore.instance.domain"
naked
/>
2026-01-09 21:47:12 +01:00
<ChevronsUpDown class="ml-auto size-4" />
</SidebarMenuButton>
<SidebarMenuButton v-else>
2026-01-09 21:47:12 +01:00
<UserPlus />
{{ m.sunny_pink_hyena_walk() }}
2026-01-09 21:47:12 +01:00
<ChevronsUpDown class="ml-auto size-4" />
</SidebarMenuButton>
</AccountManager>
</SidebarMenuItem>
<SidebarMenuItem class="flex flex-col gap-2">
2025-12-09 22:32:22 +01:00
<Button
v-if="authStore.isSignedIn"
variant="default"
size="lg"
class="w-full group-data-[collapsible=icon]:px-4"
@click="useEvent('composer:open')"
>
2026-01-09 21:47:12 +01:00
<Pen />
<span class="group-data-[collapsible=icon]:hidden">
{{ m.salty_aloof_turkey_nudge() }}
</span>
</Button>
2025-12-09 22:32:22 +01:00
<Button
v-if="authStore.isSignedIn"
size="lg"
variant="secondary"
@click="useEvent('preferences:open')"
>
2026-01-09 21:47:12 +01:00
<Cog />
Preferences
</Button>
2025-12-09 22:32:22 +01:00
<Button
v-if="$pwa?.needRefresh"
variant="destructive"
size="lg"
class="w-full group-data-[collapsible=icon]:px-4"
@click="$pwa?.updateServiceWorker(true)"
>
2026-01-09 21:47:12 +01:00
<DownloadCloud />
<span class="group-data-[collapsible=icon]:hidden">
{{ m.quaint_low_felix_pave() }}
</span>
</Button>
</SidebarMenuItem>
</SidebarMenu>
</SidebarFooter>
</template>