diff --git a/src/features/dashboard/components/QuickActions.tsx b/src/features/dashboard/components/QuickActions.tsx
index d1f4532..77ddec5 100644
--- a/src/features/dashboard/components/QuickActions.tsx
+++ b/src/features/dashboard/components/QuickActions.tsx
@@ -1,8 +1,15 @@
-import { useNavigate } from 'react-router-dom';
-import { Plus, UserPlus, Shield, Settings, Building2, BadgeCheck } from 'lucide-react';
-import { useAppSelector } from '@/hooks/redux-hooks';
-import type { QuickAction } from '@/types/dashboard';
-import { useAppTheme } from '@/hooks/useAppTheme';
+import { useNavigate } from "react-router-dom";
+import {
+ Plus,
+ UserPlus,
+ Shield,
+ Settings,
+ Building2,
+ BadgeCheck,
+} from "lucide-react";
+import { useAppSelector } from "@/hooks/redux-hooks";
+import type { QuickAction } from "@/types/dashboard";
+import { useAppTheme } from "@/hooks/useAppTheme";
export const QuickActions = () => {
const { primaryColor } = useAppTheme();
@@ -11,50 +18,102 @@ export const QuickActions = () => {
// Helper to check permission
const hasPermission = (resource: string, action: string) => {
- if (roles.includes('super_admin') || roles.includes('tenant_admin')) return true;
- return permissions.some(p => p.resource === resource && p.action === action);
+ if (roles.includes("super_admin") || roles.includes("tenant_admin"))
+ return true;
+ return permissions.some(
+ (p) => p.resource === resource && p.action === action,
+ );
};
- const isSuperAdmin = roles.includes('super_admin');
+ const isSuperAdmin = roles.includes("super_admin");
// Define actions based on role
const superAdminActions: QuickAction[] = [
- { icon: Plus, label: 'New Tenant', onClick: () => navigate('/tenants/create-wizard') },
- { icon: UserPlus, label: 'Module', onClick: () => navigate('/modules') },
- { icon: Shield, label: 'Notification', onClick: () => navigate('/notifications') },
- { icon: Settings, label: 'Audit Logs', onClick: () => navigate('/audit-logs') },
+ {
+ icon: Plus,
+ label: "New Tenant",
+ onClick: () => navigate("/tenants/create-wizard"),
+ },
+ { icon: UserPlus, label: "Module", onClick: () => navigate("/modules") },
+ {
+ icon: Shield,
+ label: "Notification",
+ onClick: () => navigate("/notifications"),
+ },
+ {
+ icon: Settings,
+ label: "Audit Logs",
+ onClick: () => navigate("/audit-logs"),
+ },
];
const tenantAdminActions: QuickAction[] = [
- hasPermission('users', 'create') && { icon: UserPlus, label: 'New User', onClick: () => navigate('/tenant/users') },
- hasPermission('roles', 'create') && { icon: Shield, label: 'New Role', onClick: () => navigate('/tenant/roles') },
- hasPermission('departments', 'create') && { icon: Building2, label: 'New Dept', onClick: () => navigate('/tenant/departments') },
- hasPermission('designations', 'create') && { icon: BadgeCheck, label: 'New Desig', onClick: () => navigate('/tenant/designations') },
+ hasPermission("users", "create") && {
+ icon: UserPlus,
+ label: "New User",
+ onClick: () => navigate("/tenant/users"),
+ },
+ hasPermission("roles", "create") && {
+ icon: Shield,
+ label: "New Role",
+ onClick: () => navigate("/tenant/roles"),
+ },
+ hasPermission("departments", "create") && {
+ icon: Building2,
+ label: "New Dept",
+ onClick: () => navigate("/tenant/departments"),
+ },
+ hasPermission("designations", "create") && {
+ icon: BadgeCheck,
+ label: "New Desig",
+ onClick: () => navigate("/tenant/designations"),
+ },
].filter(Boolean) as QuickAction[];
const actions = isSuperAdmin ? superAdminActions : tenantAdminActions;
-
return (
-
-
-
Quick Actions
-
+
+ {/* Header */}
+
+
+ Quick Actions
+
-
+ {/* Actions Grid */}
+
{actions.map((action, index) => {
const Icon = action.icon;
+
return (