"use client"; import { GlobalOutlined, ClockCircleOutlined, DownOutlined } from '@ant-design/icons'; import { WandSparkles, RectangleHorizontal, RectangleVertical } from 'lucide-react'; import { Dropdown, Menu, Tooltip } from 'antd'; import { LanguageOptions, VideoDurationOptions } from './config-options'; import type { ConfigOptions, LanguageValue, VideoDurationValue } from './config-options'; import { PortraitAnimeSelector } from './PortraitAnimeSelector'; interface ConfigPanelProps { /** Current configuration options */ configOptions: ConfigOptions; /** Handler for configuration changes */ onConfigChange: (key: K, value: ConfigOptions[K]) => void; /** Whether it's mobile device */ isMobile?: boolean; /** Whether it's desktop device */ isDesktop?: boolean; } /** * Configuration panel component for video creation settings. * Includes language, auto script, duration, and aspect ratio selectors. * @param {ConfigOptions} configOptions - current configuration * @param {Function} onConfigChange - handler for config changes * @param {boolean} isMobile - whether it's mobile device * @param {boolean} isDesktop - whether it's desktop device * @returns {JSX.Element} */ export const ConfigPanel = ({ configOptions, onConfigChange, isMobile = false, isDesktop = true, }: ConfigPanelProps) => { /** Language dropdown menu */ const languageMenu = ( onConfigChange('language', key as LanguageValue)} items={LanguageOptions.map((option) => ({ key: option.value, label: {option.label}, }))} /> ); /** Duration dropdown menu */ const durationMenu = ( onConfigChange('videoDuration', key as VideoDurationValue)} items={VideoDurationOptions.map((option) => ({ key: option.value, label: {option.label}, }))} /> ); const currentLanguage = LanguageOptions.find((option) => option.value === configOptions.language); const currentDuration = configOptions.videoDuration === 'unlimited' ? 'auto' : configOptions.videoDuration; return (
{/* Language selector */} {/* Auto script toggle */} {/* Duration selector */} {/* Aspect ratio toggles */}
{/* Portrait/Anime selector */} onConfigChange('pcode', v)} />
); };