Add error handling, enhance syncing, and refactor deletion logic
- Introduce new error messages for syncing and book deletion in `en.json`. - Update `DeleteBook` to support local-only deletion and synced book management. - Refine offline/online behavior with `deleteLocalToo` checkbox and update related state handling. - Extend repository and IPC methods to handle optional IDs for updates. - Add `SyncQueueContext` for queueing offline changes and improving synchronization workflows. - Enhance refined text generation logic in `DraftCompanion` and `GhostWriter` components. - Replace PUT with PATCH for world updates to align with API expectations. - Streamline `AlertBox` by integrating dynamic translation keys for deletion prompts.
This commit is contained in:
@@ -15,6 +15,7 @@ interface AlertBoxProps {
|
||||
cancelText?: string;
|
||||
onConfirm: () => Promise<void>;
|
||||
onCancel: () => void;
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
||||
export default function AlertBox(
|
||||
@@ -25,7 +26,8 @@ export default function AlertBox(
|
||||
confirmText = 'Confirmer',
|
||||
cancelText = 'Annuler',
|
||||
onConfirm,
|
||||
onCancel
|
||||
onCancel,
|
||||
children
|
||||
}: AlertBoxProps) {
|
||||
const [mounted, setMounted] = useState(false);
|
||||
|
||||
@@ -86,9 +88,9 @@ export default function AlertBox(
|
||||
</div>
|
||||
|
||||
<div className="p-6 bg-dark-background/30">
|
||||
<p className="mb-6 text-text-primary whitespace-pre-line leading-relaxed">{message}</p>
|
||||
|
||||
<div className="flex justify-end gap-3">
|
||||
<p className="text-text-primary whitespace-pre-line leading-relaxed">{message}</p>
|
||||
{children}
|
||||
<div className="flex justify-end gap-3 mt-6">
|
||||
<CancelButton callBackFunction={onCancel} text={cancelText}/>
|
||||
<ConfirmButton text={confirmText} buttonType={type} callBackFunction={onConfirm}/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user