fix(blog): represent absent article imagery honestly
Deploy Canina / deploy (push) Successful in 3m12s
Deploy Canina / deploy (push) Successful in 3m12s
This commit is contained in:
1 parent
5642c1609c
commit
18094f91a6
17 files changed
+208
-24
No files matched your search
@@ -0,0 +1,13 @@
|
||||
"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="" />;
|
||||
}
|
||||
Reference in new issue
Block a user