Bind cms page

This commit is contained in:
AmirReza Jamali
2025-11-15 09:43:45 +03:30
parent efbdb82535
commit 4839c325a5
5 changed files with 593 additions and 448 deletions
+28
View File
@@ -0,0 +1,28 @@
"use client";
import Image, { ImageProps } from "next/image";
import { useState } from "react";
interface ImageWithFallbackProps extends Omit<ImageProps, "src" | "alt"> {
src: string;
alt: string;
fallbackSrc?: string;
}
export default function ImageWithFallback({
src,
alt,
fallbackSrc = "/clipboard.svg",
...props
}: ImageWithFallbackProps) {
const [imgSrc, setImgSrc] = useState(src);
return (
<Image
{...props}
src={imgSrc}
alt={alt}
onError={() => setImgSrc(fallbackSrc)}
/>
);
}