@@ -20,10 +20,9 @@ export interface ContentImageData {
|
||||
interface ContentImageCellProps {
|
||||
image: ContentImageData | null;
|
||||
maxPromptLength?: number;
|
||||
onImageClick?: () => void;
|
||||
}
|
||||
|
||||
export default function ContentImageCell({ image, maxPromptLength = 100, onImageClick }: ContentImageCellProps) {
|
||||
export default function ContentImageCell({ image, maxPromptLength = 100 }: ContentImageCellProps) {
|
||||
const [showFullPrompt, setShowFullPrompt] = useState(false);
|
||||
|
||||
// Check if image_path is a valid local file path (not a URL)
|
||||
@@ -114,14 +113,7 @@ export default function ContentImageCell({ image, maxPromptLength = 100, onImage
|
||||
<img
|
||||
src={getLocalImageUrl(image.image_path)}
|
||||
alt={prompt || 'Generated image'}
|
||||
className={`w-full h-24 object-cover rounded border border-gray-300 dark:border-gray-600 ${
|
||||
onImageClick ? 'cursor-pointer hover:opacity-80 transition-opacity' : ''
|
||||
}`}
|
||||
onClick={() => {
|
||||
if (onImageClick) {
|
||||
onImageClick();
|
||||
}
|
||||
}}
|
||||
className="w-full h-24 object-cover rounded border border-gray-300 dark:border-gray-600"
|
||||
onError={(e) => {
|
||||
// Show empty placeholder if local image fails to load
|
||||
const target = e.target as HTMLImageElement;
|
||||
|
||||
Reference in New Issue
Block a user