chore: simplify status display by replacing EnforceSwitch with badges

This commit is contained in:
Wikzyy
2025-03-18 10:36:40 +07:00
parent 7772252bab
commit 1cfda6745e
2 changed files with 18 additions and 8 deletions

View File

@ -85,11 +85,16 @@ const ManagePositionContextProvider = ({ children }: { children: React.ReactNode
enableSorting: false,
enableHiding: false,
cell: ({ row }) => {
const isActive = row.original.status === 'Y';
return (
<EnforceSwitch
enforce={row.original.status == 'Y' ? true : false}
onChange={() => {}}
/>
<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: {

View File

@ -127,11 +127,16 @@ const ManageUserContextProvider = ({ children }: { children: React.ReactNode })
enableSorting: false,
enableHiding: false,
cell: ({ row }) => {
const isActive = row.original.status === 'Y';
return (
<EnforceSwitch
enforce={row.original.status == 'Y' ? true : false}
onChange={() => {}}
/>
<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: {