fix bug panel error && change design dashboard
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user