fix bug panel error && change design dashboard

This commit is contained in:
Ehsan
2024-10-23 19:53:08 +03:30
parent adfe52c531
commit b25289f88e
11 changed files with 22 additions and 15 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
import CustomTable from "@/app/component/CustomTable";
import { Button, Switch, TableCell, TableRow } from "@mui/material";
import { Button, TableCell, TableRow } from "@mui/material";
import TextLoading from "@/app/component/loading/Text";
import TrashB from "@/components/icons/TrashB";
import EditB from "@/components/icons/EditB";
@@ -4,7 +4,7 @@ import EditB from "@/components/icons/EditB";
import TrashB from "@/components/icons/TrashB";
import { Button } from "@mui/material";
function Item({ data, loading }) {
function Item({ data, loading, changeStatus }) {
return (
<li className="rounded-[8px] bg-[#FFF] p-[12px] dark:shadow-transparent dark:bg-[#222433] shadow-[0px_1px_24.8px_0px_rgba(204,_204,_204,_0.18)]">
<div className="w-full flex items-center justify-between">
@@ -14,7 +14,11 @@ function Item({ data, loading }) {
<p className="text-[16px] min-w-[60px] font-medium text-[#616161] dark:text-[#A1A1A1]">
{data.status ? "فعال" : "غیر فعال"}
</p>
<SwitchTable value={data.status} />
<SwitchTable
id={data.id}
value={data.status}
changeStatus={changeStatus}
/>
</div>
</TextLoading>
</div>
@@ -1,10 +1,10 @@
import Item from "./Item";
function Cards({ data, loading }) {
function Cards({ data, loading, changeStatus }) {
return (
<ul className="md:hidden mt-[24px] grid grid-cols-1 sm:grid-cols-2 gap-[16px]">
{data.map((item, idx) => (
<Item data={item} key={idx} />
<Item data={item} key={idx} changeStatus={changeStatus} />
))}
</ul>
);