import React from 'react'; import { createElement } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { useContentPlan } from '../context/ContentPlanContext'; interface RecalculateScheduleModalProps { isOpen: boolean; onClose: () => void; onConfirm: () => void; futureItemsCount: number; oldInterval: number; newInterval: number; } const RecalculateScheduleModal: React.FC = ({ isOpen, onClose, onConfirm, futureItemsCount, oldInterval, newInterval, }) => { const { getString } = useContentPlan(); if (!isOpen) return null; return (
{/* Backdrop */}
{/* Modal */}
{/* Header */}

{getString( 'recalculate_schedule', 'title', 'Recalculate Scheduled Dates?' )}

{/* Content */}

{getString( 'recalculate_schedule', 'message', "You've changed the publish interval from {oldInterval} to {newInterval} days. There are {count} future content plan items that may need their scheduled dates recalculated." ) .replace( '{oldInterval}', oldInterval.toString() ) .replace( '{newInterval}', newInterval.toString() ) .replace( '{count}', futureItemsCount.toString() )}

{getString( 'recalculate_schedule', 'question', 'Would you like to recalculate the scheduled dates for these future items based on the new interval?' )}

{getString( 'recalculate_schedule', 'note', 'Note: Only future scheduled items will be affected. Past dates will remain unchanged.' )}

{/* Footer */}
); }; export default RecalculateScheduleModal;