14 lines
626 B
TypeScript
14 lines
626 B
TypeScript
"use client";
|
|
import React from "react";
|
|
import SafeImage from "./SafeImage";
|
|
|
|
type BlogImageProps = React.ComponentProps<typeof SafeImage>;
|
|
|
|
/** An empty blog image slot is not an article photograph or a pending upload. */
|
|
export default function BlogImage({ src, className, ...props }: BlogImageProps) {
|
|
if (!src?.trim()) {
|
|
return <div className={`flex items-center justify-center bg-medical-gray-100 text-medical-gray-500 text-xs ${className || ""}`}>بدون تصویر</div>;
|
|
}
|
|
return <SafeImage {...props} src={src} className={className} fallbackText="تصویر در دسترس نیست" fallbackAlt="" />;
|
|
}
|