/* * Copyright (C) Contributors to the Suwayomi project * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import Dialog from '@mui/material/Dialog'; import DialogTitle from '@mui/material/DialogTitle'; import DialogContent from '@mui/material/DialogContent'; import DialogActions from '@mui/material/DialogActions'; import Button from '@mui/material/Button'; import Stack from '@mui/material/Stack'; import { useLingui } from '@lingui/react/macro'; import { CheckboxInput } from '@/base/components/inputs/CheckboxInput.tsx'; import type { AwaitableComponentProps } from 'awaitable-component'; import Typography from '@mui/material/Typography'; import WarningIcon from '@mui/icons-material/Warning'; import { useState } from 'react'; import type { MigrationBulkSearchSettings } from '@/features/migration/Migration.types.ts'; export const MigrationBulkSearchOptionsDialog = ({ isVisible, onDismiss, onSubmit, onExitComplete, }: AwaitableComponentProps) => { const { t } = useLingui(); const [selectHighestChapterNumberSource, setSelectHighestChapterNumberSource] = useState(false); const [ignoreOutdatedMatches, setIgnoreOutdatesMatches] = useState(false); const [performAdvancedSearch, setPerformAdvancedSearch] = useState(false); return ( {t`Search options`} {t`Ignore matches without newer chapters`} {t`Do not automatically select matches if they are behind the current source. They will still be shown in the found matches`} } sx={{ alignItems: 'start', }} checked={ignoreOutdatedMatches} onChange={(_, checked) => setIgnoreOutdatesMatches(checked)} /> {t`These options are slow and dangerous and may lead to restrictions from sources`} {t`Advanced search mode`} {t`Breaks down the title into keywords for a wider search`} } sx={{ alignItems: 'start', }} checked={performAdvancedSearch} onChange={(_, checked) => setPerformAdvancedSearch(checked)} /> {t`Match based on chapter number`} {t`If enabled, chooses the match furthest ahead.\nOtherwise, picks the first match by source priority.`} } sx={{ alignItems: 'start', }} checked={selectHighestChapterNumberSource} onChange={(_, checked) => setSelectHighestChapterNumberSource(checked)} /> ); };