|
|
|
|
@ -11,9 +11,10 @@ import { usePopup } from "../../stores/usePopup.js";
|
|
|
|
|
import { PanoramaIcon } from "../../icons/PanoramaIcon";
|
|
|
|
|
import {useOtherGroups, usePostamatesAndPvzGroups} from "../../api.js";
|
|
|
|
|
import {useMemo} from "react";
|
|
|
|
|
import {getFilteredGroups} from "../../utils.js";
|
|
|
|
|
import {doesMatchFilter, getFilteredGroups} from "../../utils.js";
|
|
|
|
|
import Checkbox from "antd/es/checkbox/Checkbox";
|
|
|
|
|
import {usePointSelection} from "../../stores/usePointSelection.js";
|
|
|
|
|
import {usePendingPointsFilters} from "../../stores/usePendingPointsFilters.js";
|
|
|
|
|
|
|
|
|
|
const getRivalsName = (feature) => {
|
|
|
|
|
const { data: postamatesAndPvzGroups } = usePostamatesAndPvzGroups();
|
|
|
|
|
@ -88,12 +89,14 @@ const SingleFeaturePopup = ({ feature }) => {
|
|
|
|
|
const MultipleFeaturesPopup = ({ features }) => {
|
|
|
|
|
const { setPopup } = usePopup();
|
|
|
|
|
const { selection, include, exclude } = usePointSelection();
|
|
|
|
|
const { filters, ranges } = usePendingPointsFilters();
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="space-y-2 p-1">
|
|
|
|
|
{features.map((feature) => {
|
|
|
|
|
const featureId = feature.properties.id;
|
|
|
|
|
const isSelected = !selection.excluded.has(featureId) || selection.included.has(featureId);
|
|
|
|
|
const isSelected = (doesMatchFilter(filters, ranges, feature) && !selection.excluded.has(featureId)) ||
|
|
|
|
|
selection.included.has(featureId);
|
|
|
|
|
const handleSelect = () => {
|
|
|
|
|
if (isSelected) {
|
|
|
|
|
exclude(featureId);
|
|
|
|
|
@ -111,7 +114,7 @@ const MultipleFeaturesPopup = ({ features }) => {
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
className="text-start flex-1 w-0"
|
|
|
|
|
className="text-start flex-1 !w-0"
|
|
|
|
|
block
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setPopup({
|
|
|
|
|
|