- Updated translation utility to improve consistency and reduce redundancy. - Removed deprecated useTrans hook and related code. - Introduced a new Zustand store for managing translations and locale settings. - Cleaned up unused hooks and files related to localization.
23 lines
795 B
TypeScript
23 lines
795 B
TypeScript
import { HistoryIcon } from "lucide-react";
|
|
|
|
import { type NavListLinksProps } from "@/back/Components/Layout/Sidebar/AppSidebar";
|
|
import { type SidebarGroupLink } from "@/back/Components/Layout/Sidebar/SidebarRegistry";
|
|
import type { AuthProp } from "@/back/types/global";
|
|
import str from "@/hooks/use-string";
|
|
import trans from "@/hooks/use-translations";
|
|
|
|
export default function ActivityLogs(auth: AuthProp): SidebarGroupLink {
|
|
const modelName = "activity-logs";
|
|
const transActivityLogs = trans(`uwil-backend::models.classes.${modelName}`, {
|
|
choice: 2,
|
|
});
|
|
|
|
const link: NavListLinksProps = {
|
|
title: str(transActivityLogs).ucFirst().value(),
|
|
model: modelName,
|
|
icon: HistoryIcon,
|
|
show: auth.policies.activityLogs.viewAny,
|
|
};
|
|
|
|
return { link, group: "admin" };
|
|
}
|