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 SPToggleGroupControl from "../../components/toggleGroupControl/toggleGroupControl";
import { inArray } from "../../controls/controls";
import ProInfo from "../../components/proInfo/proInfo";
export const GridFiveGeneralTab = ({ attributes, setAttributes }) => {
const {
postGridLayout,
gridFiveColumns,
itemsPerPage,
gridFiveHorizontalGap,
gridFiveVerticalGap,
contentAlignment,
// gridFiveMasonryEnable,
preloaderEnable,
equalHeightEnable,
blockName,
generalLinkOpen,
// masonryGap,
largeItemHeight,
smallItemHeight,
postLimit,
metaDisplayType,
paginationEnable,
liveFilterEnable,
clientId,
} = attributes;
const layouts = useLayouts(blockName, postGridLayout);
const paginationBlock = getPaginationBlock(clientId);
const layoutChange = (newValue) => {
if (newValue === postGridLayout) return;
const newData = {
postGridLayout: newValue,
postLimit:
3 === postLimit || 4 === postLimit
? inArray(["grid-five-layout-one", "grid-five-layout-two", "grid-five-layout-three"], newValue)
? 3
: 4
: postLimit,
};
setAttributes(newData);
};
const paginationToggle = (newValue) => {
if (!newValue && paginationBlock) {
const { block, select } = paginationBlock;
select(block.clientId);
}
setAttributes({ paginationEnable: !newValue });
};
return (
<>
{layouts?.length > 0 && (
)}
{!equalHeightEnable && (
)}
{/* { gridFiveMasonryEnable && (
) } */}
, value: "left" },
{ label: , value: "center" },
{ label: , value: "right" },
]}
/>
{/* */}
{/* */}
Unlock exclusive layouts and advanced display controls. Upgrade to Pro!
>
);
};