fix(ui): section icons in the phone menu

This commit is contained in:
sam committed 2026-10-18 23:53:44 +11:00
1 parent 3f0fd7409d
commit 9ff62f2cc4
2 files changed
+91 -83

No files matched your search

+11 -3
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { Menu } from "@lucide/vue";
import { Building2, LayoutDashboard, ListChecks, Menu, Server, Workflow, Zap, type LucideIcon } from "@lucide/vue";
import { Button } from "@/components/ui/button";
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "@/components/ui/sheet";
@@ -19,6 +19,14 @@ const open = ref(false);
const links = computed(() =>
navTree(props.hidden).flatMap((node): NavEntry[] => (node.kind === "link" ? [node.entry] : [])),
);
const icons: Record<string, LucideIcon> = {
"/": LayoutDashboard,
"/tasks": ListChecks,
"/workflows": Workflow,
"/events": Zap,
"/org": Building2,
"/settings": Server,
};
const activePath = computed(() => activeNavPath(route.path));
watch(() => route.path, () => (open.value = false));
@@ -42,8 +50,8 @@ watch(() => route.path, () => (open.value = false));
:to="entry.path"
:aria-current="activePath === entry.path ? 'page' : undefined"
:data-current="activePath === entry.path ? '' : undefined"
class="text-fg-muted hover:text-foreground hover:bg-accent data-current:text-foreground data-current:bg-accent focus-visible:ring-ring/50 flex h-11 items-center rounded-md px-3 text-sm font-medium transition-colors outline-none focus-visible:ring-[3px]"
>{{ entry.label }}</RouterLink
class="text-fg-muted hover:text-foreground hover:bg-accent data-current:text-foreground data-current:bg-accent focus-visible:ring-ring/50 flex h-11 items-center gap-3 rounded-md px-3 text-sm font-medium transition-colors outline-none focus-visible:ring-[3px]"
><component :is="icons[entry.path]" v-if="icons[entry.path]" class="size-4" aria-hidden="true" />{{ entry.label }}</RouterLink
>
</nav>
</SheetContent>