This commit is contained in:
Андрей Дувакин 2024-10-07 23:28:31 +05:00
parent 6f0d2fc84b
commit 3f43b5d1c9

View File

@ -114,11 +114,11 @@ const DeliveryOrderDetails = () => {
<div className="delivery-order-details">
{loading ? (
<div className="spinner-border" role="status">
<span className="visually-hidden">Загрузка...</span>
<span className="visually-hidden">Загрузка</span>
</div>
) : (
<div className="content-container">
<table className="table mb-5">
<table className="table table-bordered mb-5">
<thead>
<tr>
<th scope="col">Общая стоимость</th>
@ -135,32 +135,39 @@ const DeliveryOrderDetails = () => {
</tbody>
</table>
<ol className="city-list">
<h3 className="mb-3">Маршрут</h3>
<table className="table table-bordered">
<thead>
<tr>
<th scope="col">Город</th>
<th scope="col">Комплектующее</th>
<th scope="col">Количество</th>
<th scope="col">Объем</th>
</tr>
</thead>
<tbody>
{deliveryAccessories.map((accessory, index) => {
const coord = coordinates.find(
(c) => c.city === accessory.city_name
);
return (
<li key={accessory.id} className="city-item">
<strong>Доставка:</strong> {accessory.accessory_name}
<span className="city-info">
(Город: {accessory.city_name}, Координаты:{" "}
{coord
? `${coord.latitude}, ${coord.longitude}`
: "Не найдены"}
)
</span>
</li>
<tr key={index}>
<td>{accessory.city_name}</td>
<td>{accessory.accessory_name}</td>
<td>{accessory.count}</td>
<td>{accessory.volume}</td>
</tr>
);
})}
<li className="city-item">
<strong>Конечный пункт:</strong> {DELIVERY_CITY.name}
<span className="city-info">
(Координаты: {DELIVERY_CITY.latitude}, {DELIVERY_CITY.longitude}
)
</span>
</li>
</ol>
<tr>
<td>{DELIVERY_CITY.name}</td>
<td>Конечный пункт</td>
<td>-</td>
<td>-</td>
</tr>
</tbody>
</table>
{coordinates.length > 0 && (
<div className="map-container">
<MapContainer