37 lines
979 B
TypeScript
37 lines
979 B
TypeScript
// * Packages
|
|
import { UsersIcon } from "lucide-react";
|
|
// * Other
|
|
import {
|
|
filterActions,
|
|
NavListLinksProps,
|
|
} from "@/back/Components/Layout/Sidebar/AppSidebar";
|
|
import { SidebarGroupLink } from "@/back/Components/Layout/Sidebar/SidebarRegistry";
|
|
|
|
import str from "@/hooks/use-string";
|
|
import { GetTranslation } from "@/lib/utils";
|
|
|
|
import container from "@/services/container";
|
|
|
|
export default function Users(): SidebarGroupLink {
|
|
const authService = container.resolve("authService");
|
|
const modelName = "users";
|
|
const transUsers = GetTranslation(
|
|
`uwil-backend::models.classes.${modelName}`,
|
|
{
|
|
choice: 2,
|
|
},
|
|
);
|
|
|
|
const link: NavListLinksProps = {
|
|
title: str(transUsers).ucFirst().value(),
|
|
model: modelName,
|
|
icon: UsersIcon,
|
|
show: authService.canGlobal(
|
|
"viewAny",
|
|
String.raw`Uwil\LaravelBackend\Models\User`,
|
|
),
|
|
actions: (model: string) => filterActions({ model }),
|
|
};
|
|
|
|
return { link, group: "admin" };
|
|
}
|