import { useEffect, useState } from "react"; import { Button, Modal } from "antd"; import { WandSparkles, X } from "lucide-react"; import { ImageSettingsPanel } from "@/components/image-settings-panel"; import { ModelPicker } from "@/components/model-picker"; import { canvasThemes } from "@/lib/canvas-theme"; import { defaultImageParamsForModel } from "@/lib/model-selection"; import { useActiveTheme } from "@/stores/canvas/use-canvas-theme-store"; import type { AiConfig } from "@/stores/use-config-store"; export type BatchGenerationSettings = Pick; type BatchGenerationSettingsDialogProps = { open: boolean; config: AiConfig; rowCount: number; concurrency: number; onClose: () => void; onConfirm: (settings: BatchGenerationSettings) => void; }; export function BatchGenerationSettingsDialog({ open, config, rowCount, concurrency, onClose, onConfirm }: BatchGenerationSettingsDialogProps) { const theme = canvasThemes[useActiveTheme()]; const [generationConfig, setGenerationConfig] = useState(config); useEffect(() => { if (open) setGenerationConfig(config); }, [config, open]); const handleConfigChange = (key: "quality" | "size" | "transparentBackground" | "count", value: string) => { setGenerationConfig((current) => ({ ...current, [key]: value })); }; const handleModelChange = (model: string) => { setGenerationConfig((current) => ({ ...current, model, imageModel: model, ...defaultImageParamsForModel(current, model) })); }; const imageModel = generationConfig.imageModel || generationConfig.model; return (
共 {rowCount} 个未完成任务 · 并发上限 {concurrency}
生成模型
); }