"use client"; import { GlobalOutlined, ClockCircleOutlined, CloseOutlined, DownOutlined } from '@ant-design/icons'; import { WandSparkles, RectangleHorizontal, RectangleVertical, Palette } from 'lucide-react'; import { Modal, Dropdown, Menu } from 'antd'; import { LanguageOptions, VideoDurationOptions } from './config-options'; import type { ConfigOptions, LanguageValue, VideoDurationValue } from './config-options'; import { useEffect, useState } from 'react'; import { fetchSettingByCode } from '@/api/serversetting'; interface MobileConfigModalProps { /** Modal visibility state */ visible: boolean; /** Close handler */ onClose: () => void; /** Current configuration options */ configOptions: ConfigOptions; /** Handler for configuration changes */ onConfigChange: (key: K, value: ConfigOptions[K]) => void; } /** * Mobile configuration modal with card-style selections. * Provides a modern, non-traditional form interface for video settings. * @param {boolean} visible - Modal visibility * @param {Function} onClose - Close handler * @param {ConfigOptions} configOptions - Current configuration * @param {Function} onConfigChange - Handler for config changes * @returns {JSX.Element} */ export function MobileConfigModal({ visible, onClose, configOptions, onConfigChange, }: MobileConfigModalProps) { const [animeOptions, setAnimeOptions] = useState>([]); useEffect(() => { let mounted = true; (async () => { const list = await fetchSettingByCode>('comic_config', []); if (!mounted) return; if (Array.isArray(list) && list.length > 0) { setAnimeOptions(list); } else { setAnimeOptions([ { name: 'Korean Comics Long', pcode: 'STANDARD_V1_734684_116483' }, ]); } })(); return () => { mounted = false; }; }, []); const isPortrait = configOptions.pcode === 'portrait'; const currentLanguage = LanguageOptions.find(opt => opt.value === configOptions.language); /** Language dropdown menu */ const languageMenu = ( onConfigChange('language', key as LanguageValue)} items={LanguageOptions.map((option) => ({ key: option.value, label: ( {option.label} ), }))} /> ); /** Anime dropdown menu */ const animeMenu = ( onConfigChange('pcode', key)} items={animeOptions.map((option) => ({ key: option.pcode, label: ( {option.name} ), }))} /> ); return ( } width="90%" style={{ maxWidth: '420px' }} styles={{ mask: { backdropFilter: 'blur(2px)', backgroundColor: 'transparent' }, content: { padding: 0, backdropFilter: 'blur(4px)', backgroundColor: 'rgba(0, 0, 0, 0.7)', border: '1px solid rgba(255, 255, 255, 0.1)', borderRadius: '20px', }, }} >
{/* Header */}

Video Settings

{/* Language Row */}
Language
{/* AutoScript Row */}
AI Copilot
{/* Video Duration Row */}
Duration
{VideoDurationOptions.map((option) => ( ))}
{/* Aspect Ratio Row */}
Aspect Ratio
{/* Video Style Row */}
Video Style
); }