change display status

This commit is contained in:
Wikzyy
2025-03-27 09:30:40 +07:00
parent d9c487f464
commit 0f69423e96
2 changed files with 32 additions and 4 deletions

View File

@ -137,10 +137,24 @@ const ManageWalletRuleContextProvider = ({ children }: { children: React.ReactNo
accessorFn: (row) => row.status,
id: 'status',
header: ({ column }) => <DataGridColumnHeader title="Status" column={column} />,
enableSorting: true,
enableSorting: false,
enableHiding: false,
cell: ({ row }) => {
const isActive = row.original.status === 'Y';
return (
<span
className={`px-2 py-1 text-xs font-semibold rounded-full ${
isActive ? 'bg-green-100 text-green-600' : 'bg-red-100 text-red-600'
}`}
>
{isActive ? 'Active' : 'Inactive'}
</span>
);
},
meta: {
headerClassName: 'w-[250px]'
headerClassName: 'w-[100px]',
cellClassName: 'text-center'
}
},
{