import {
RotateLeftOutlined,
RotateRightOutlined,
SwapOutlined,
ZoomInOutlined,
ZoomOutOutlined,
} from "@ant-design/icons";
import React, { useState } from "react";
import { Image, Space } from "antd";
import { CiImageOff } from "react-icons/ci"; // Assuming you're using this icon from react-icons
const ColumnsImage = ({ src }: any) => {
const [hasError, setHasError] = useState(false); // Track if the image has an error
const imageUrl = src;
if (hasError) {
// If there is an error, display the fallback icon
return ;
}
if(!imageUrl){
return ;
}
return (
setHasError(true)} // Triggered when image fails to load
preview={{
toolbarRender: (
_,
{
transform: { scale },
actions: {
onFlipY,
onFlipX,
onRotateLeft,
onRotateRight,
onZoomOut,
onZoomIn,
},
},
) => (
),
}}
/>
);
};
export default ColumnsImage;