import React from 'react'; import { CloseIcon, FullscreenEnterIcon, FullscreenExitIcon } from './icons'; // Import fullscreen icons import { AiImageQuality, AiDimensionsMode } from '../hooks/useAiFeatures'; import { TFunction } from '../types'; interface SettingsPanelProps { isOpen: boolean; onClose: () => void; showZoomSlider: boolean; onShowZoomSliderChange: (show: boolean) => void; aiImageQuality: AiImageQuality; onAiImageQualityChange: (quality: AiImageQuality) => void; aiApiEndpoint: string; onAiApiEndpointChange: (endpoint: string) => void; aiDimensionsMode: AiDimensionsMode; onAiDimensionsModeChange: (mode: AiDimensionsMode) => void; isFullscreenActive: boolean; onToggleFullscreen: () => void; currentCanvasWidth: number; currentCanvasHeight: number; onCanvasSizeChange: (width: number, height: number) => void; t: TFunction; } const CANVAS_SIZE_OPTIONS = [ { label: '1024 x 1536 px', width: 1024, height: 1536 }, { label: '1024 x 1024 px', width: 1024, height: 1024 }, { label: '1200 x 1200 px', width: 1200, height: 1200 }, { label: '1600 x 1600 px', width: 1600, height: 1600 }, { label: '2000 x 2000 px', width: 2000, height: 2000 }, { label: '4000 x 4000 px', width: 4000, height: 4000 }, ]; const AI_API_OPTIONS = [ { labelKey: 'pollinationsApi', value: 'https://rpfor.deno.dev/proxy?url=https://image.pollinations.ai/prompt/{prompt}?nologo=true&model=gptimage&image={imgurl.url}&quality={quality}{size_params}' }, { labelKey: 'geminiSimpleGetApi', value: 'https://geminisimpleget.deno.dev/prompt/{prompt}?image={imgurl.url}' } ] as const; const SettingsPanel: React.FC = ({ isOpen, onClose, showZoomSlider, onShowZoomSliderChange, aiImageQuality, onAiImageQualityChange, aiApiEndpoint, onAiApiEndpointChange, aiDimensionsMode, onAiDimensionsModeChange, isFullscreenActive, onToggleFullscreen, currentCanvasWidth, currentCanvasHeight, onCanvasSizeChange, t, }) => { if (!isOpen) return null; const qualityOptions: { label: string; value: AiImageQuality }[] = [ { label: t('qualityLow'), value: 'low' }, { label: t('qualityMedium'), value: 'medium' }, { label: t('qualityHigh'), value: 'high' }, ]; const handleSizeSelection = (event: React.ChangeEvent) => { const selectedValue = event.target.value; const [newWidth, newHeight] = selectedValue.split('x').map(Number); if (!isNaN(newWidth) && !isNaN(newHeight)) { onCanvasSizeChange(newWidth, newHeight); } }; const currentSizeValue = `${currentCanvasWidth}x${currentCanvasHeight}`; return (

{t('settingsTitle')}

{/* Interface Settings */}

{t('interface')}

{/* Zoom Slider Toggle */}
{/* Fullscreen Toggle */}
{/* Canvas Dimensions Settings */}

{t('canvasDimensions')}

{t('canvasSizeDescription')}

{/* AI Image Generation Settings */}

{t('aiImageGeneration')}

{t('apiEndpointDescription')}

{t('aiImageDimensionsDescription')}

{t('imageQualityDescription')}

); }; export default SettingsPanel;