import { Button, IconButton, Popover } from "@mui/material"; import { useState } from "react"; import TuneIcon from "@mui/icons-material/Tune"; import { useDispatch, useSelector } from "react-redux"; import { SlaughterAllocateToGuild } from "../../../slaughter-house/components/slaughter-allocate-to-guild/SlaughterAllocateToGuild"; import { OPEN_MODAL } from "../../../../lib/redux/slices/appSlice"; import { Grid } from "../../../../components/grid/Grid"; import { StewardNorEnterdBarChangeState } from "../../../guild/components/StewardNorEnterdBarChangeState"; import { slaughterDeleteAllocatedService } from "../../../slaughter-house/services/salughter-delete-allocated"; import { fetchSlaughterBroadcastAndProducts } from "../../../slaughter-house/services/handle-fetch-slaughter-products"; import { checkPathStartsWith } from "../../../../utils/checkPathStartsWith"; export const StewardShowAllocationsOperations = ({ item, type, handleUpdate, priceInfo, remainWeight, updateTable, }) => { const dispatch = useDispatch(); const [popoverOpen, setPopoverOpen] = useState(false); const [anchorEl, setAnchorEl] = useState(null); const selectedSubUser = useSelector( (state) => state.userSlice.selectedSubUser ); const openPopover = (event) => { setPopoverOpen(true); setAnchorEl(event.currentTarget); }; const closePopover = () => { setPopoverOpen(false); setAnchorEl(null); }; const handleDistributeToGuild = () => { closePopover(); const handleEditSuccess = () => { if (updateTable) updateTable(1); if (handleUpdate) handleUpdate(); }; dispatch( OPEN_MODAL({ title: "ویرایش توزیع و فروش محصول", content: ( ), }) ); }; return (
{type && ( )} {!type && ( )} {!type && ( )}
); };