handle just one item is active

This commit is contained in:
Ehsan
2024-10-23 01:53:33 +03:30
parent 7c14323126
commit 09532bc47d
5 changed files with 37 additions and 8 deletions
+6 -2
View File
@@ -5,7 +5,7 @@ import TrashB from "@/components/icons/TrashB";
import EditB from "@/components/icons/EditB";
import SwitchTable from "@/app/component/SwitchTable";
function List({ data, loading }) {
function List({ data, loading, changeStatus }) {
const tableHead = ["ردیف", "شماره کارت", "شماره شبا", "بانک", "وضعیت", ""];
const centerTable = [0, 4, 5];
@@ -59,7 +59,11 @@ function List({ data, loading }) {
<p className="text-[16px] min-w-[60px] dark:text-[#A1A1A1] font-medium text-[#616161]">
{row.status ? "فعال" : "غیر فعال"}
</p>
<SwitchTable value={row.status} />
<SwitchTable
id={row.id}
value={row.status}
changeStatus={changeStatus}
/>
</div>
</TextLoading>
</TableCell>