iamge modal
This commit is contained in:
@@ -52,6 +52,7 @@ export const createImagesPageConfig = (
|
||||
setCurrentPage: (page: number) => void;
|
||||
maxInArticleImages?: number; // Optional: max in-article images to display
|
||||
onGenerateImages?: (contentId: number) => void; // Handler for generate images button
|
||||
onImageClick?: (contentId: number, imageType: 'featured' | 'in_article', position?: number) => void; // Handler for image click
|
||||
}
|
||||
): ImagesPageConfig => {
|
||||
const maxImages = handlers.maxInArticleImages || 5; // Default to 5 in-article images
|
||||
@@ -84,7 +85,10 @@ export const createImagesPageConfig = (
|
||||
sortable: false,
|
||||
width: '200px',
|
||||
render: (_value: any, row: ContentImagesGroup) => (
|
||||
<ContentImageCell image={row.featured_image} />
|
||||
<ContentImageCell
|
||||
image={row.featured_image}
|
||||
onImageClick={handlers.onImageClick ? () => handlers.onImageClick!(row.content_id, 'featured') : undefined}
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -98,7 +102,12 @@ export const createImagesPageConfig = (
|
||||
width: '200px',
|
||||
render: (_value: any, row: ContentImagesGroup) => {
|
||||
const image = row.in_article_images.find(img => img.position === i);
|
||||
return <ContentImageCell image={image || null} />;
|
||||
return (
|
||||
<ContentImageCell
|
||||
image={image || null}
|
||||
onImageClick={handlers.onImageClick && image ? () => handlers.onImageClick!(row.content_id, 'in_article', i) : undefined}
|
||||
/>
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user