feat(logs): add workspace activity log page

This commit is contained in:
2026-04-28 16:42:36 +03:30
parent 088ad8760b
commit 8bd0e908a1
11 changed files with 1247 additions and 22 deletions

View File

@@ -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) =>