add: active state
This commit is contained in:
@@ -10,6 +10,7 @@ import { Tooltip } from "../components/Tooltip/Tooltip";
|
|||||||
import Button from "../components/Button/Button";
|
import Button from "../components/Button/Button";
|
||||||
import { LiveStockAddLiveStock } from "../partials/live-stock/LiveStockAddLiveStock";
|
import { LiveStockAddLiveStock } from "../partials/live-stock/LiveStockAddLiveStock";
|
||||||
import { useDrawerStore } from "../context/zustand-store/appStore";
|
import { useDrawerStore } from "../context/zustand-store/appStore";
|
||||||
|
import { CheckCircleIcon, XCircleIcon } from "@heroicons/react/24/outline";
|
||||||
|
|
||||||
export default function LiveStocks() {
|
export default function LiveStocks() {
|
||||||
const [pagesInfo, setPagesInfo] = useState({ page: 1, page_size: 10 });
|
const [pagesInfo, setPagesInfo] = useState({ page: 1, page_size: 10 });
|
||||||
@@ -42,6 +43,19 @@ export default function LiveStocks() {
|
|||||||
item?.gender === 1 ? "نر" : "ماده",
|
item?.gender === 1 ? "نر" : "ماده",
|
||||||
// item?.species?.name,
|
// item?.species?.name,
|
||||||
item?.weight_type === "L" ? "سبک" : "سنگین",
|
item?.weight_type === "L" ? "سبک" : "سنگین",
|
||||||
|
<span className="flex items-center gap-1">
|
||||||
|
{item?.active ? (
|
||||||
|
<>
|
||||||
|
<span className="text-green-500">فعال</span>
|
||||||
|
<CheckCircleIcon className="w-5 h-5 text-green-500" />
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<span className="text-red-500">غیرفعال</span>
|
||||||
|
<XCircleIcon className="w-5 h-5 text-red-500" />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</span>,
|
||||||
<Popover key={i}>
|
<Popover key={i}>
|
||||||
<Tooltip title="ویرایش دام" position="right">
|
<Tooltip title="ویرایش دام" position="right">
|
||||||
<Button
|
<Button
|
||||||
@@ -95,6 +109,7 @@ export default function LiveStocks() {
|
|||||||
"جنسیت",
|
"جنسیت",
|
||||||
// "گونه",
|
// "گونه",
|
||||||
"دسته وزنی",
|
"دسته وزنی",
|
||||||
|
"وضعیت",
|
||||||
"عملیات",
|
"عملیات",
|
||||||
]}
|
]}
|
||||||
rows={pagesTableData}
|
rows={pagesTableData}
|
||||||
|
|||||||
Reference in New Issue
Block a user