diff --git a/src/app/(modules)/roles/components/RoleTable.tsx b/src/app/(modules)/roles/components/RoleTable.tsx
index 8b0f95e..8aa8834 100644
--- a/src/app/(modules)/roles/components/RoleTable.tsx
+++ b/src/app/(modules)/roles/components/RoleTable.tsx
@@ -2,7 +2,7 @@
import type { ColumnDef, SortingState } from '@tanstack/react-table';
import type { ReactNode } from 'react';
-import { Edit, RotateCcw } from 'lucide-react';
+import { Edit, ShieldCheck, ShieldX } from 'lucide-react';
import { DataTable } from '@/components/data-table';
import { PERMISSIONS } from '@/constants/permissions';
@@ -58,7 +58,12 @@ export function RoleTable({
},
{
label: (role) => (role.effective_status ? 'Deactivate' : 'Activate'),
- icon: ,
+ icon: (role) =>
+ role.effective_status ? (
+
+ ) : (
+
+ ),
permission: PERMISSIONS.ROLE.DELETE,
disabled: () => isStatusPending,
onClick: onToggleStatus,
diff --git a/src/app/(modules)/users/components/UserTable.tsx b/src/app/(modules)/users/components/UserTable.tsx
index cb1476e..2997abb 100644
--- a/src/app/(modules)/users/components/UserTable.tsx
+++ b/src/app/(modules)/users/components/UserTable.tsx
@@ -2,7 +2,7 @@
import type { ReactNode } from 'react';
import type { ColumnDef, SortingState } from '@tanstack/react-table';
-import { Edit, RotateCcw } from 'lucide-react';
+import { Edit, UserCheck, UserX } from 'lucide-react';
import { DataTable } from '@/components/data-table';
import { PERMISSIONS } from '@/constants/permissions';
@@ -59,7 +59,12 @@ export function UserTable({
{
label: (user) =>
user.effective_status === 'active' ? 'Deactivate' : 'Activate',
- icon: ,
+ icon: (user) =>
+ user.effective_status === 'active' ? (
+
+ ) : (
+
+ ),
permission: PERMISSIONS.USER.DELETE,
disabled: (user) =>
pendingUserId === user.id || user.effective_status === 'pending',
diff --git a/src/components/app-sidebar.tsx b/src/components/app-sidebar.tsx
index cf76c3a..0647935 100644
--- a/src/components/app-sidebar.tsx
+++ b/src/components/app-sidebar.tsx
@@ -14,6 +14,14 @@ import {
CollapsibleContent,
CollapsibleTrigger,
} from '@/components/ui/collapsible';
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuLabel,
+ DropdownMenuSeparator,
+ DropdownMenuTrigger,
+} from '@/components/ui/dropdown-menu';
import {
Sidebar,
SidebarContent,
@@ -124,6 +132,7 @@ function SidebarNavItem({
item: MenuItem;
pathname: string;
}) {
+ const { isMobile, state } = useSidebar();
const isActive = isRouteActive(pathname, item.path);
const isChildActive =
item.children?.some((child) => isRouteActive(pathname, child.path)) ??
@@ -136,6 +145,52 @@ function SidebarNavItem({
}, [isChildActive]);
if (hasChildren) {
+ if (state === 'collapsed' && !isMobile) {
+ return (
+
+
+
+
+
+ {item.title}
+
+
+
+
+ {item.title}
+
+ {item.children?.map((child) =>
+ child.path ? (
+
+
+
+ {child.title}
+
+
+ ) : null,
+ )}
+
+
+
+ );
+ }
+
return (
{
label: string | ((item: TData) => string);
- icon: React.ReactNode;
+ icon: React.ReactNode | ((item: TData) => React.ReactNode);
onClick: (item: TData) => void;
permission?: PermissionInput;
disabled?: (item: TData) => boolean;
@@ -163,6 +163,10 @@ function DataTableContent({
typeof action.label === 'function'
? action.label(item)
: action.label;
+ const icon =
+ typeof action.icon === 'function'
+ ? action.icon(item)
+ : action.icon;
return (
({
action.onClick(item);
}}
>
- {action.icon}
+ {icon}
);
})}