Image genartiona dn temaplte design redesign
This commit is contained in:
@@ -94,6 +94,11 @@ export default function SiteSettings() {
|
||||
const [aiSettingsLoading, setAiSettingsLoading] = useState(false);
|
||||
const [aiSettingsSaving, setAiSettingsSaving] = useState(false);
|
||||
|
||||
// Image size information (from model config)
|
||||
const [featuredImageSize, setFeaturedImageSize] = useState('1792x1024');
|
||||
const [landscapeImageSize, setLandscapeImageSize] = useState('1792x1024');
|
||||
const [squareImageSize, setSquareImageSize] = useState('1024x1024');
|
||||
|
||||
// Sectors selection state
|
||||
const [industries, setIndustries] = useState<Industry[]>([]);
|
||||
const [selectedIndustry, setSelectedIndustry] = useState<string>('');
|
||||
@@ -364,6 +369,11 @@ export default function SiteSettings() {
|
||||
setSelectedStyle(response.image_generation.selected_style || 'photorealistic');
|
||||
setMaxImages(response.image_generation.max_images ?? 4);
|
||||
setMaxAllowed(response.image_generation.max_allowed ?? 4);
|
||||
|
||||
// Set image sizes from model config
|
||||
setFeaturedImageSize(response.image_generation.featured_image_size || '1792x1024');
|
||||
setLandscapeImageSize(response.image_generation.landscape_image_size || '1792x1024');
|
||||
setSquareImageSize(response.image_generation.square_image_size || '1024x1024');
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error('Error loading AI settings:', error);
|
||||
@@ -986,6 +996,22 @@ export default function SiteSettings() {
|
||||
className="w-full"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Image Sizes Display */}
|
||||
<div className="grid grid-cols-3 gap-3 pt-2 border-t border-gray-200 dark:border-gray-700">
|
||||
<div className="text-center">
|
||||
<p className="text-xs text-gray-500 dark:text-gray-400 mb-1">Featured Image</p>
|
||||
<p className="text-sm font-medium text-gray-900 dark:text-white">{featuredImageSize}</p>
|
||||
</div>
|
||||
<div className="text-center">
|
||||
<p className="text-xs text-gray-500 dark:text-gray-400 mb-1">Landscape</p>
|
||||
<p className="text-sm font-medium text-gray-900 dark:text-white">{landscapeImageSize}</p>
|
||||
</div>
|
||||
<div className="text-center">
|
||||
<p className="text-xs text-gray-500 dark:text-gray-400 mb-1">Square</p>
|
||||
<p className="text-sm font-medium text-gray-900 dark:text-white">{squareImageSize}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Card>
|
||||
|
||||
@@ -455,7 +455,8 @@ export default function Images() {
|
||||
|
||||
if (imageType === 'featured' && contentGroup.featured_image) {
|
||||
image = contentGroup.featured_image;
|
||||
} else if (imageType === 'in_article' && position) {
|
||||
} else if (imageType === 'in_article' && position !== undefined) {
|
||||
// Position is 0-indexed, so check for undefined instead of falsy
|
||||
image = contentGroup.in_article_images.find(img => img.position === position) || null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user