refactor(lst): more dashboard work

This commit is contained in:
2025-02-20 13:18:47 -06:00
parent 604fdf1545
commit d939332499
13 changed files with 152 additions and 190 deletions

View File

@@ -68,12 +68,12 @@ const rolePermissions: Roles = {
},
};
const users: User[] = [
{id: 1, username: "admin", role: "admin"},
{id: 2, username: "manager", role: "manager"},
{id: 3, username: "supervisor", role: "supervisor"},
{id: 4, username: "user", role: "user"},
];
// const users: User[] = [
// {id: 1, username: "admin", role: "admin"},
// {id: 2, username: "manager", role: "manager"},
// {id: 3, username: "supervisor", role: "supervisor"},
// {id: 4, username: "user", role: "user"},
// ];
function hasAccess(user: User, moduleName: string, feature: Feature): boolean {
return rolePermissions[user.role]?.[moduleName]?.includes(feature) || false;

View File

@@ -1,3 +1,4 @@
import {Link} from "@tanstack/react-router";
import {SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem} from "../../ui/sidebar";
export function Header() {
@@ -5,15 +6,18 @@ export function Header() {
<SidebarHeader>
<SidebarMenu>
<SidebarMenuItem>
<SidebarMenuButton size="lg" asChild>
<div>
<img src="/imgs/dkLst.png" alt="Description" className="size-8" />
<div className="flex flex-col gap-0.5 leading-none">
<span className="font-semibold">Logistics Support Tool</span>
<span className="">v1.0.0</span>
<Link to="/">
<SidebarMenuButton size="lg" asChild>
<div className="flex flex-row">
<img src="/imgs/dkLst.png" alt="Description" className="size-8" />
<div className="flex flex-col gap-0.5 leading-none">
<span className="font-semibold">Logistics Support Tool</span>
<span className="">v1.0.0</span>
</div>
</div>
</div>
</SidebarMenuButton>
</SidebarMenuButton>
</Link>
</SidebarMenuItem>
</SidebarMenu>
</SidebarHeader>

View File

@@ -1,4 +1,4 @@
import {Cylinder, Package, Printer, Truck} from "lucide-react";
import {Cylinder, Package, Truck} from "lucide-react";
import {
SidebarGroup,
SidebarGroupContent,

View File

@@ -11,7 +11,7 @@ import {
const items = [
{
title: "One Click Print",
url: "#",
url: "/ocp",
icon: Printer,
},
];

View File

@@ -0,0 +1,51 @@
import * as React from "react"
import * as AvatarPrimitive from "@radix-ui/react-avatar"
import { cn } from "@/lib/utils"
function Avatar({
className,
...props
}: React.ComponentProps<typeof AvatarPrimitive.Root>) {
return (
<AvatarPrimitive.Root
data-slot="avatar"
className={cn(
"relative flex size-8 shrink-0 overflow-hidden rounded-full",
className
)}
{...props}
/>
)
}
function AvatarImage({
className,
...props
}: React.ComponentProps<typeof AvatarPrimitive.Image>) {
return (
<AvatarPrimitive.Image
data-slot="avatar-image"
className={cn("aspect-square size-full", className)}
{...props}
/>
)
}
function AvatarFallback({
className,
...props
}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
return (
<AvatarPrimitive.Fallback
data-slot="avatar-fallback"
className={cn(
"bg-muted flex size-full items-center justify-center rounded-full",
className
)}
{...props}
/>
)
}
export { Avatar, AvatarImage, AvatarFallback }