mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 16:03:21 +00:00
fix: gestion du jour d'échéance
This commit is contained in:
@ -1,12 +1,18 @@
|
||||
import React, { useState } from 'react';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Check } from 'lucide-react';
|
||||
import Popup from '@/components/Popup';
|
||||
|
||||
const DateTab = ({ dates, activeTab, handleDateChange, handleEdit, type, paymentPlanId }) => {
|
||||
const DateTab = ({ dates, activeTab, handleDateChange, handleEdit, type, paymentPlanId, resetModifiedDates }) => {
|
||||
const [popupVisible, setPopupVisible] = useState(false);
|
||||
const [popupMessage, setPopupMessage] = useState("");
|
||||
const [modifiedDates, setModifiedDates] = useState({});
|
||||
|
||||
useEffect(() => {
|
||||
if (resetModifiedDates) {
|
||||
setModifiedDates({});
|
||||
}
|
||||
}, [resetModifiedDates]);
|
||||
|
||||
const submit = (updatedData) => {
|
||||
const dataWithType = {
|
||||
...updatedData,
|
||||
@ -52,13 +58,9 @@ const DateTab = ({ dates, activeTab, handleDateChange, handleEdit, type, payment
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<Popup
|
||||
visible={popupVisible}
|
||||
message={popupMessage}
|
||||
onConfirm={() => setPopupVisible(false)}
|
||||
onCancel={() => setPopupVisible(false)}
|
||||
uniqueConfirmButton={true}
|
||||
/>
|
||||
{popupVisible && (
|
||||
<Popup message={popupMessage} onClose={() => setPopupVisible(false)} />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user