import React, { useState } from 'react'; import { Group, Button, Text, ActionIcon, Stack, Select } from '@mantine/core'; import { useTranslation } from 'react-i18next'; import SortIcon from '@mui/icons-material/Sort'; import ArrowUpwardIcon from '@mui/icons-material/ArrowUpward'; import ArrowDownwardIcon from '@mui/icons-material/ArrowDownward'; interface MergeFileSorterProps { onSortFiles: (sortType: 'filename' | 'dateModified', ascending: boolean) => void; disabled?: boolean; } const MergeFileSorter: React.FC = ({ onSortFiles, disabled = false, }) => { const { t } = useTranslation(); const [sortType, setSortType] = useState<'filename' | 'dateModified'>('filename'); const [ascending, setAscending] = useState(true); const sortOptions = [ { value: 'filename', label: t('merge.sortBy.filename', 'File Name') }, { value: 'dateModified', label: t('merge.sortBy.dateModified', 'Date Modified') }, ]; const handleSort = () => { onSortFiles(sortType, ascending); }; const handleDirectionToggle = () => { setAscending(!ascending); }; return ( {t('merge.sortBy.description', "Files will be merged in the order they're selected. Drag to reorder or sort below.")}