style: do inputs design modification
This commit is contained in:
@@ -2,8 +2,10 @@
|
||||
|
||||
import type { ColumnDef, SortingState } from '@tanstack/react-table';
|
||||
import type { ReactNode } from 'react';
|
||||
import { Edit, RotateCcw } from 'lucide-react';
|
||||
|
||||
import { DataTable } from '@/components/data-table';
|
||||
import { PERMISSIONS } from '@/constants/permissions';
|
||||
import type { Role } from '@/types';
|
||||
|
||||
interface RoleTableProps {
|
||||
@@ -18,6 +20,9 @@ interface RoleTableProps {
|
||||
onPageChange: (skip: number) => void;
|
||||
onLimitChange: (limit: number) => void;
|
||||
onSortingChange: (sorting: SortingState) => void;
|
||||
onEdit: (role: Role) => void;
|
||||
onToggleStatus: (role: Role) => void;
|
||||
isStatusPending: boolean;
|
||||
}
|
||||
|
||||
export function RoleTable({
|
||||
@@ -32,6 +37,9 @@ export function RoleTable({
|
||||
onPageChange,
|
||||
onLimitChange,
|
||||
onSortingChange,
|
||||
onEdit,
|
||||
onToggleStatus,
|
||||
isStatusPending,
|
||||
}: RoleTableProps) {
|
||||
return (
|
||||
<DataTable
|
||||
@@ -41,6 +49,21 @@ export function RoleTable({
|
||||
isLoading={isLoading}
|
||||
toolbar={toolbar}
|
||||
emptyTitle="No roles found."
|
||||
actions={[
|
||||
{
|
||||
label: 'Edit',
|
||||
icon: <Edit className="size-4" />,
|
||||
permission: PERMISSIONS.ROLE.UPDATE,
|
||||
onClick: onEdit,
|
||||
},
|
||||
{
|
||||
label: (role) => (role.effective_status ? 'Deactivate' : 'Activate'),
|
||||
icon: <RotateCcw className="size-4" />,
|
||||
permission: PERMISSIONS.ROLE.DELETE,
|
||||
disabled: () => isStatusPending,
|
||||
onClick: onToggleStatus,
|
||||
},
|
||||
]}
|
||||
pagination={{
|
||||
skip,
|
||||
limit,
|
||||
|
||||
Reference in New Issue
Block a user