import React from 'react' import { Box, Paper, Typography, TextField, MenuItem, FormControlLabel, Switch, Collapse, IconButton, Divider, } from '@mui/material' // Select is used internally by TextField with select prop, no need to import import { ExpandMore, ExpandLess } from '@mui/icons-material' import { useOptionsStore } from '../stores/optionsStore' interface SectionProps { title: string children: React.ReactNode defaultExpanded?: boolean } const Section: React.FC = ({ title, children, defaultExpanded = false }) => { const [expanded, setExpanded] = React.useState(defaultExpanded) return ( setExpanded(!expanded)} > {title} {expanded ? : } {children} ) } export const OptionsPanel: React.FC = () => { const { options, setOptions } = useOptionsStore() const handleChange = (field: string, value: any) => { setOptions({ [field]: value }) } return ( ⚙️ Options {/* Tracklist Section */}
handleChange('tracklist_format', e.target.value)} fullWidth size="small" helperText="Placeholders: %ts (timestamp), %tn (track name), %an (author), %al (album), %date, %ext" />
{/* Output Section */}
handleChange('format', e.target.value)} fullWidth size="small" > MP3 M4A MKV MP4 OGG OPUS FLAC WAV AAC handleChange('transcode_to', e.target.value || undefined)} fullWidth size="small" > Copy (no transcoding) MP3 (LAME) AAC OPUS handleChange('drop_video', e.target.checked)} /> } label="Drop video streams" /> handleChange('drop_subs', e.target.checked)} /> } label="Drop subtitle streams" />
{/* Filename Section */}
handleChange('output_template', e.target.value)} fullWidth size="small" helperText="Placeholders: %tn (track name), %an (author), %al (album), %date, %ext, %num" /> handleChange('number_tracks', e.target.checked)} /> } label="Number tracks (01 - )" /> handleChange('replace_bad_chars', e.target.checked)} /> } label="Replace bad characters" /> handleChange('replacement_char', e.target.value)} size="small" disabled={!options.replace_bad_chars} /> handleChange('bad_chars', e.target.value)} fullWidth size="small" disabled={!options.replace_bad_chars} /> handleChange('skip_existing', e.target.checked)} /> } label="Skip existing files" />
{/* Metadata Section */}
handleChange('album', e.target.value)} fullWidth size="small" /> handleChange('comment', e.target.value)} fullWidth size="small" /> handleChange('no_comment', e.target.checked)} /> } label="No comment" /> handleChange('comment_stream', e.target.value === '' ? null : parseInt(e.target.value)) } size="small" disabled={options.no_comment} /> handleChange('merge_comments', e.target.checked)} /> } label="Merge all comments" disabled={options.no_comment} /> handleChange('comment_separator', e.target.value)} size="small" disabled={!options.merge_comments || options.no_comment} />
) }