Add cancelText parameter
This commit is contained in:
parent
32f5cdc494
commit
7b703f015f
3 changed files with 9 additions and 10 deletions
|
|
@ -133,6 +133,7 @@ export function DocumentSettings({ isOpen, setIsOpen, epub, html }: {
|
||||||
estimatedTimeRemaining={estimatedTimeRemaining || undefined}
|
estimatedTimeRemaining={estimatedTimeRemaining || undefined}
|
||||||
onCancel={handleCancel}
|
onCancel={handleCancel}
|
||||||
isProcessing={epub ? isAudioCombining : isPDFAudioCombining}
|
isProcessing={epub ? isAudioCombining : isPDFAudioCombining}
|
||||||
|
cancelText="Cancel and download"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Transition appear show={isOpen} as={Fragment}>
|
<Transition appear show={isOpen} as={Fragment}>
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,10 @@ interface ProgressPopupProps {
|
||||||
isProcessing: boolean;
|
isProcessing: boolean;
|
||||||
statusMessage?: string;
|
statusMessage?: string;
|
||||||
operationType?: 'sync' | 'load';
|
operationType?: 'sync' | 'load';
|
||||||
|
cancelText?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ProgressPopup({ isOpen, progress, estimatedTimeRemaining, onCancel, isProcessing, statusMessage, operationType }: ProgressPopupProps) {
|
export function ProgressPopup({ isOpen, progress, estimatedTimeRemaining, onCancel, isProcessing, statusMessage, operationType, cancelText = 'Cancel' }: ProgressPopupProps) {
|
||||||
return (
|
return (
|
||||||
<Transition
|
<Transition
|
||||||
show={isOpen}
|
show={isOpen}
|
||||||
|
|
@ -52,19 +53,15 @@ export function ProgressPopup({ isOpen, progress, estimatedTimeRemaining, onCanc
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="inline-flex justify-center rounded-lg px-2.5 py-1
|
className="inline-flex items-center justify-center gap-1 rounded-lg px-2.5 py-1 font-medium text-foreground hover:text-accent focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 transform transition-transform duration-200 ease-in-out hover:scale-[1.02]"
|
||||||
font-medium text-foreground hover:text-accent focus:outline-none
|
|
||||||
focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2
|
|
||||||
transform transition-transform duration-200 ease-in-out hover:scale-[1.02]"
|
|
||||||
onClick={onCancel}
|
onClick={onCancel}
|
||||||
>
|
>
|
||||||
{isProcessing ? (
|
{isProcessing && (
|
||||||
<div className="w-full h-full flex items-center justify-end">
|
<span className="relative inline-block w-4 h-4">
|
||||||
<LoadingSpinner />
|
<LoadingSpinner />
|
||||||
</div>
|
</span>
|
||||||
) : (
|
|
||||||
'Cancel and download'
|
|
||||||
)}
|
)}
|
||||||
|
<span>{cancelText}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -569,6 +569,7 @@ export function SettingsModal() {
|
||||||
isProcessing={isSyncing || isLoading}
|
isProcessing={isSyncing || isLoading}
|
||||||
statusMessage={statusMessage}
|
statusMessage={statusMessage}
|
||||||
operationType={operationType}
|
operationType={operationType}
|
||||||
|
cancelText="Cancel"
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue