import { __ } from "@wordpress/i18n"; import { useState } from "@wordpress/element"; import ToggleGroupControl from "../../components/toggleGroupControl/toggleGroupControl"; import { Background, Border, BoxShadow, Spacing, SpColorPicker, SPRangeControl, Toggle, TypographyNew, } from "../../components"; import { BgIcon, GradientIcon, TransparentIcon } from "../../components/background/svgIcon"; // Smart Image Style Tab Panel export const SmartImageStyleTab = ({ attributes, setAttributes }) => { const { enableLink, linkType, imageBorder, imageBorderWidth, imageBorderRadius, imageBoxShadowEnable, imageBoxShadow, imageFilter, imageBlur, imageBrightness, imageContrast, imageSaturation, imageHue, linkBtnTypography, linkBtnFontSize, linkBtnLineHeight, linkBtnLetterSpacing, linkBtnWordSpacing, linkButtonColor, linkButtonBg, linkButtonBorder, linkBtnBorderWidth, linkBtnBorderWidthHover, linkBtnBorderRadius, linkBtnBorderRadiusHover, linkBtnBoxShadowEnable, linkBtnBoxShadow, linkBtnBoxShadowEnableHover, linkBtnBoxShadowHover, linkBtnPadding, } = attributes; const [linkTypeStyle, setLinkTypeStyle] = useState("image"); const [colorState, setColorState] = useState("normal"); return ( <> {enableLink && "button" === linkType && ( <> setLinkTypeStyle(newValue)} items={[ { label: "Image", value: "image" }, { label: "Button", value: "button" }, ]} /> )} {"image" === linkTypeStyle ? ( <> {imageBoxShadowEnable && ( )} {imageFilter && ( <> )} ) : ( <> { setColorState(newValue); }} items={[ { label: "Normal", value: "normal" }, { label: "Hover", value: "hover" }, ]} /> {"normal" === colorState ? ( <> { setAttributes({ linkButtonColor: { ...linkButtonColor, color: newValue, }, }); }} /> , value: "transparent", tooltip: "Transparent", }, { label: , value: "bgColor", tooltip: "Solid", }, { label: , value: "gradient", tooltip: "Gradient", }, ]} /> {linkBtnBoxShadowEnable && ( )} ) : ( <> { setAttributes({ linkButtonColor: { ...linkButtonColor, hover: newValue, }, }); }} /> , value: "transparent", tooltip: "Transparent", }, { label: , value: "bgColor", tooltip: "Solid", }, { label: , value: "gradient", tooltip: "Gradient", }, ]} /> {linkBtnBoxShadowEnableHover && ( )} )} )} ); };