mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-01-31 06:40:50 +01:00
feat: add manual sync functionality with confirmation modal in ArrModal component
This commit is contained in:
@@ -25,7 +25,10 @@ const ArrModal = ({isOpen, onClose, onSubmit, editingArr}) => {
|
||||
handleTagInputKeyDown,
|
||||
handleTestConnection,
|
||||
handleSubmit,
|
||||
handleDelete
|
||||
handleDelete,
|
||||
showSyncConfirm,
|
||||
setShowSyncConfirm,
|
||||
handleManualSync
|
||||
} = useArrModal({isOpen, onSubmit, editingArr});
|
||||
|
||||
const arrTypes = [
|
||||
@@ -444,6 +447,43 @@ const ArrModal = ({isOpen, onClose, onSubmit, editingArr}) => {
|
||||
onDataToggle={handleDataToggle}
|
||||
error={errors.data_to_sync}
|
||||
/>
|
||||
{showSyncConfirm && (
|
||||
<Modal
|
||||
isOpen={showSyncConfirm}
|
||||
onClose={() => {
|
||||
setShowSyncConfirm(false);
|
||||
onSubmit();
|
||||
}}
|
||||
title='Run Initial Sync'
|
||||
width='md'>
|
||||
<div className='space-y-4'>
|
||||
<p className='text-gray-700 dark:text-gray-300'>
|
||||
Would you like to run an initial sync now to get
|
||||
started?
|
||||
</p>
|
||||
<div className='flex justify-end space-x-3'>
|
||||
<button
|
||||
type='button'
|
||||
onClick={() => {
|
||||
setShowSyncConfirm(false);
|
||||
onSubmit();
|
||||
}}
|
||||
className='px-3 py-2 text-sm rounded-lg bg-gray-200 hover:bg-gray-300
|
||||
dark:bg-gray-700 dark:hover:bg-gray-600
|
||||
text-gray-700 dark:text-gray-200 font-medium transition-colors'>
|
||||
Skip
|
||||
</button>
|
||||
<button
|
||||
type='button'
|
||||
onClick={handleManualSync}
|
||||
className='px-3 py-2 text-sm rounded-lg bg-blue-600 hover:bg-blue-700
|
||||
text-white font-medium transition-colors'>
|
||||
Start Sync
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
)}
|
||||
</form>
|
||||
</Modal>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user