import { useState } from "@wordpress/element";
import {
Background,
BoxShadow,
Divider,
SelectField,
Spacing,
SpColorPicker,
SPToggleGroupControl,
} from "../../components";
import { __, _n } from "@wordpress/i18n";
import { BgIcon, GradientIcon, TransparentIcon } from "../../components/background/svgIcon";
import Border from "../../components/border/border";
import Toggle from "../../components/toggle/toggle";
export const Content = ({ attributes, setAttributes }) => {
const {
contentVerticalPosition,
contentHorizontalPosition,
blockName,
postCardBg,
postCardBorder,
postCardHoverBorder,
postCardBorderWidth,
postCardBorderRadius,
postCardBoxShadowEnable,
postCardBoxShadow,
postCardPadding,
postCardHoverBorderWidth,
postCardHoverBorderRadius,
postCardHoverBoxShadowEnable,
postCardHoverBoxShadow,
contentAreaMargin,
blockLayoutName,
hoverAnimation,
layout,
displayOverlyThum,
displayOverlyHoverThum,
imageOverlayColor,
imageOverlayCustomColor,
imageOverlayHoverColor,
imageOverlayCustomHoverColor,
contentMultiColorBg,
contentAreaBg,
catRadius,
showHideDivider,
} = attributes;
const [contentAreaBgStyleType, setContentAreaBgStyleType] = useState("color");
return (
<>
{!["taxonomy-layout-five", "taxonomy-layout-six", "taxonomy-layout-one"].includes(layout) && (
)}
{[
"taxonomy-layout-four",
"taxonomy-layout-seven",
"taxonomy-layout-eight",
"taxonomy-layout-five",
"taxonomy-layout-six",
].includes(layout) && (
<>
>
)}
{["taxonomy-layout-seven"].includes(layout) && (
<>
>
)}
setContentAreaBgStyleType(val)}
/>
{layout !== "taxonomy-layout-five" &&
layout !== "taxonomy-layout-six" &&
layout !== "taxonomy-layout-one" && (
<>
{contentAreaBgStyleType === "color" ? (
<>
{"taxonomy-layout-eight" === layout && (
)}
{!["taxonomy-layout-four", "taxonomy-layout-seven", "taxonomy-layout-eight"].includes(
layout
) && (
)}
{displayOverlyThum && (
<>
{"custom" === imageOverlayColor && (
setAttributes({
imageOverlayCustomColor: newColor,
})
}
defaultColor="#eecacaff"
/>
)}
>
)}
>
) : (
<>
{!["taxonomy-layout-four", "taxonomy-layout-seven", "taxonomy-layout-eight"].includes(
layout
) && (
)}
{displayOverlyHoverThum && (
<>
{"custom" === imageOverlayHoverColor && (
setAttributes({
imageOverlayCustomHoverColor: newColor,
})
}
defaultColor="#eecacaff"
/>
)}
>
)}
>
)}
>
)}
{(layout === "taxonomy-layout-five" ||
(layout === "taxonomy-layout-eight" && !contentMultiColorBg) ||
layout === "taxonomy-layout-four" ||
layout === "taxonomy-layout-six" ||
(!displayOverlyThum && contentAreaBgStyleType === "color") ||
(contentAreaBgStyleType === "hover" && !displayOverlyHoverThum)) && (
,
value: "transparent",
tooltip: "Transparent",
},
{
label: ,
value: "bgColor",
tooltip: "Solid",
},
{
label: ,
value: "gradient",
tooltip: "Gradient",
},
]}
/>
)}
{contentAreaBgStyleType === "color" ? (
<>
{(layout !== "taxonomy-layout-one" || !showHideDivider) && (
<>
>
)}
{postCardBoxShadowEnable && (
)}
>
) : (
<>
{(layout !== "taxonomy-layout-one" || !showHideDivider) && (
<>
>
)}
{postCardHoverBoxShadowEnable && (
)}
>
)}
{["taxonomy-layout-four", "taxonomy-layout-eight"].includes(layout) && (
)}
{layout !== "taxonomy-layout-three" && (
)}
{layout !== "taxonomy-layout-six" && (
)}
>
);
};