diff --git a/frontend/src/BillingManager.jsx b/frontend/src/BillingManager.jsx index f9fb7ae..b5510cd 100644 --- a/frontend/src/BillingManager.jsx +++ b/frontend/src/BillingManager.jsx @@ -1,5 +1,13 @@ import { useState, useEffect, useRef } from 'react'; import api from './lib/api.js'; +import axios from 'axios'; +import FormModal from './components/FormModal.jsx'; +import ConfirmModal from './components/ConfirmModal.jsx'; +import Pagination from './components/Pagination.jsx'; +import PageHeader from './components/PageHeader.jsx'; +import PageHeaderActions from './components/PageHeaderActions.jsx'; +import FormField from './components/FormField.jsx'; +import ErrorAlert from './components/ErrorAlert.jsx'; import { IconPlus, IconEdit, @@ -21,8 +29,6 @@ import { IconHistory } from '@tabler/icons-react'; -const API_URL = '/api'; - function BillingManager() { const [billingData, setBillingData] = useState([]); const [loading, setLoading] = useState(false); @@ -468,59 +474,51 @@ function BillingManager() { return (
Вы уверены, что хотите удалить элемент {selectedItem?.hostName}?
+Это действие нельзя отменить.
+ > } - // Режим редактирования платежа - if (editingPayment && editingPayment.serverId) { - setBillingData(prev => prev.map(s => { - if (s.id !== editingPayment.serverId) return s; - const payments = Array.isArray(s.payments) ? [...s.payments] : []; - if (editingPayment.index != null && payments[editingPayment.index]) { - payments[editingPayment.index] = { - date: paymentDraft.date, - amount: paymentDraft.amount, - currency: paymentDraft.currency || 'USD', - note: paymentDraft.note || '' + onConfirm={confirmDelete} + onClose={() => setShowDeleteModal(false)} + confirmLabel="Удалить" + variant="danger" + /> + {/* Модалка добавления платежа */} +Вы уверены, что хотите удалить выбранный платеж?
{paymentToDelete && ( -Вы уверены, что хотите удалить элемент {item?.hostName}?
-Это действие нельзя отменить.
-