import React from 'react'; import { CloseIcon, FullscreenEnterIcon, FullscreenExitIcon } from './icons'; // Import fullscreen icons import { AiImageQuality, AiDimensionsMode } from '../hooks/useAiFeatures'; 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; } 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 = [ { label: 'Pollinations AI', value: 'https://rpfor.deno.dev/proxy?url=https://image.pollinations.ai/prompt/{prompt}?nologo=true&model=gptimage&image={imgurl.url}&quality={quality}{size_params}' }, { label: 'Gemini Simple Get', value: 'https://geminisimpleget.deno.dev/prompt/{prompt}?image={imgurl.url}' } ]; const SettingsPanel: React.FC = ({ isOpen, onClose, showZoomSlider, onShowZoomSliderChange, aiImageQuality, onAiImageQualityChange, aiApiEndpoint, onAiApiEndpointChange, aiDimensionsMode, onAiDimensionsModeChange, isFullscreenActive, onToggleFullscreen, currentCanvasWidth, currentCanvasHeight, onCanvasSizeChange, }) => { if (!isOpen) return null; const qualityOptions: { label: string; value: AiImageQuality }[] = [ { label: 'Low', value: 'low' }, { label: 'Medium', value: 'medium' }, { label: 'High (HD)', value: 'hd' }, ]; 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 (

Application Settings

{/* Interface Settings */}

Interface

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

Canvas Dimensions

Changing size will clear the current canvas and history.

{/* AI Image Generation Settings */}

AI Image Generation

Select an API for image generation. Placeholders are filled automatically.

Controls `width` & `height` params for APIs that support them (e.g., Pollinations AI).

Used for APIs that support a 'quality' parameter (e.g., Pollinations AI).

); }; export default SettingsPanel;