import { __ } from "@wordpress/i18n";
import { Toggle, SPRangeControl, SelectField, Layouts, InputControl } from "../../components";
import { AlignCenter, AlignLeft, AlignRight } from "../../icons/icons";
import { getPaginationBlock } from "../shared/helpFn";
import useLayouts from "../../hooks/useLayouts";
import { openLinksOptions } from "../../controls/constants";
import { inArray } from "../../controls/controls";
import SPToggleGroupControl from "../../components/toggleGroupControl/toggleGroupControl";
import ProInfo from "../../components/proInfo/proInfo";
export const GridThreeGeneralTab = ({ attributes, setAttributes }) => {
const {
postGridLayout,
gridThreeColumns,
itemsPerPage,
gridThreeHorizontalGap,
gridThreeVerticalGap,
contentAlignment,
// gridThreeMasonryEnable,
preloaderEnable,
blockName,
generalLinkOpen,
masonryGap,
postLimit,
largeItemHeight,
smallItemHeight,
metaDisplayType,
paginationEnable,
liveFilterEnable,
clientId,
} = attributes;
const layouts = useLayouts(blockName, postGridLayout);
const paginationBlock = getPaginationBlock(clientId);
const paginationToggle = (newValue) => {
setAttributes({ paginationEnable: !newValue });
if (!newValue && paginationBlock) {
const { block, select } = paginationBlock;
select(block?.clientId);
}
};
const layoutHandler = (newLayout) => {
if (newLayout === postGridLayout) {
return;
}
let taxonomyPosition;
if (newLayout === "grid-three-layout-three") {
taxonomyPosition = "top-right";
} else {
taxonomyPosition = "";
}
setAttributes({
postGridLayout: newLayout,
catTabCategoryPosition: taxonomyPosition,
});
};
return (
<>
{layouts?.length > 0 && (
)}
{!["grid-three-layout-four"].includes(postGridLayout) && (
)}
{!inArray(["grid-three-layout-four"], postGridLayout) && (
)}
{/* { gridThreeMasonryEnable && (
) } */}
, value: "left" },
{ label: , value: "center" },
{ label: , value: "right" },
]}
/>
{/* */}
Unlock exclusive layouts and advanced display controls. Upgrade to Pro!
>
);
};