feat(logs): add workspace activity log page
This commit is contained in:
@@ -11,9 +11,12 @@ import {
|
||||
Briefcase,
|
||||
ChartColumn,
|
||||
Clock3,
|
||||
History,
|
||||
Tags,
|
||||
} from 'lucide-react';
|
||||
import { useWorkspace } from '../context/WorkspaceContext';
|
||||
import { useTranslation } from '../hooks/useTranslation';
|
||||
import { canWorkspace, WORKSPACE_LOGS_VIEW } from '../lib/permissions';
|
||||
|
||||
type SidebarProps = {
|
||||
mobileOpen?: boolean;
|
||||
@@ -24,7 +27,9 @@ export const Sidebar = ({ mobileOpen = false, onMobileClose }: SidebarProps) =>
|
||||
const [isCollapsed, setIsCollapsed] = useState(false);
|
||||
|
||||
const { t, lang } = useTranslation();
|
||||
const { activeWorkspace } = useWorkspace();
|
||||
const isRtl = lang === 'fa';
|
||||
const canViewLogs = canWorkspace(activeWorkspace?.my_role, WORKSPACE_LOGS_VIEW);
|
||||
|
||||
const ToggleIcon = isRtl
|
||||
? (isCollapsed ? PanelRightOpen : PanelRightClose)
|
||||
@@ -61,6 +66,15 @@ export const Sidebar = ({ mobileOpen = false, onMobileClose }: SidebarProps) =>
|
||||
icon: ChartColumn,
|
||||
label: t.sidebar?.reports || 'Reports'
|
||||
},
|
||||
...(canViewLogs
|
||||
? [
|
||||
{
|
||||
path: '/logs',
|
||||
icon: History,
|
||||
label: t.sidebar?.logs || 'Logs',
|
||||
},
|
||||
]
|
||||
: []),
|
||||
];
|
||||
|
||||
const renderNavItems = (mobile = false) =>
|
||||
|
||||
Reference in New Issue
Block a user