diff --git a/src/components/LKMenu.tsx b/src/components/LKMenu.tsx index 42f5fb5..031f107 100644 --- a/src/components/LKMenu.tsx +++ b/src/components/LKMenu.tsx @@ -64,7 +64,7 @@ const LKMenu = React.forwardRef((props, ref) => {
((props, ref) => {
= ({ legalEntiti
diff --git a/src/components/profile/ProfileActsMain.tsx b/src/components/profile/ProfileActsMain.tsx index 5c6ff36..5badac6 100644 --- a/src/components/profile/ProfileActsMain.tsx +++ b/src/components/profile/ProfileActsMain.tsx @@ -78,14 +78,14 @@ const ProfileActsMain = () => {
setActiveTab(tab)} style={{ cursor: 'pointer' }} >
{tab}
diff --git a/src/components/profile/ProfileGarageMain.tsx b/src/components/profile/ProfileGarageMain.tsx index f99eacc..c3abe4d 100644 --- a/src/components/profile/ProfileGarageMain.tsx +++ b/src/components/profile/ProfileGarageMain.tsx @@ -179,7 +179,7 @@ const ProfileGarageMain = () => { {!vehiclesLoading && filteredVehicles.map((vehicle) => (
-
+
@@ -400,10 +400,10 @@ const ProfileGarageMain = () => { {!historyLoading && searchHistory.length > 0 && (
{searchHistory.map((historyItem) => ( -
+
-
+
{historyItem.brand && historyItem.model ? `${historyItem.brand} ${historyItem.model}` : 'Автомобиль найден'} diff --git a/src/components/profile/ProfileHistoryItem.tsx b/src/components/profile/ProfileHistoryItem.tsx index 877895e..aedbcbe 100644 --- a/src/components/profile/ProfileHistoryItem.tsx +++ b/src/components/profile/ProfileHistoryItem.tsx @@ -48,7 +48,7 @@ const ProfileHistoryItem: React.FC = ({ return ( <>
-
+
{date}
diff --git a/src/components/profile/ProfileHistoryTabs.tsx b/src/components/profile/ProfileHistoryTabs.tsx index af69cfd..1ef54df 100644 --- a/src/components/profile/ProfileHistoryTabs.tsx +++ b/src/components/profile/ProfileHistoryTabs.tsx @@ -69,7 +69,7 @@ const ProfileHistoryTabs: React.FC = ({ {tabs.map((tab) => (
= ({ onClick={() => onTabChange(tab)} >
= ({ tabIndex={0} >
setIsDropdownOpen((prev) => !prev)} > {selectedManufacturer} diff --git a/src/components/profile/ProfileOrdersMain.tsx b/src/components/profile/ProfileOrdersMain.tsx index 466fcec..d81d0e9 100644 --- a/src/components/profile/ProfileOrdersMain.tsx +++ b/src/components/profile/ProfileOrdersMain.tsx @@ -172,12 +172,12 @@ const ProfileOrdersMain: React.FC = (props) => { {tabs.map((tab, idx) => (
setActiveTab(idx)} >
{tab.label}
diff --git a/src/components/vin/InfoVin.tsx b/src/components/vin/InfoVin.tsx index 84c654e..f08c1a6 100644 --- a/src/components/vin/InfoVin.tsx +++ b/src/components/vin/InfoVin.tsx @@ -1,4 +1,5 @@ import React, { useState, useEffect, useRef } from "react"; +import VehicleAttributesTooltip from './VehicleAttributesTooltip'; interface VehicleAttribute { key: string; @@ -206,42 +207,14 @@ const InfoVin: React.FC = ({ {/* Tooltip с фиксированным позиционированием */} - {showTooltip && vehicleAttributes.length > 0 && ( -
- {/* Заголовок */} -
-

- Полная информация об автомобиле -

-

{vehicleName}

-
- - {/* Атрибуты в сетке */} -
- {vehicleAttributes.map((attr, index) => ( -
-
{attr.name}
-
{attr.value}
-
- ))} -
- - {/* Подвал */} -
-
- Всего параметров: {vehicleAttributes.length} -
-
-
- )} + 0} + position={tooltipPosition} + vehicleName={vehicleName} + vehicleAttributes={vehicleAttributes} + onMouseEnter={handleMouseEnter} + onMouseLeave={handleMouseLeave} + /> ); }; diff --git a/src/components/vin/KnotParts.tsx b/src/components/vin/KnotParts.tsx index e3aaacd..e0fa50c 100644 --- a/src/components/vin/KnotParts.tsx +++ b/src/components/vin/KnotParts.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useRef } from "react"; + import React, { useState, useEffect, useRef } from "react"; import { useRouter } from "next/router"; interface KnotPartsProps { @@ -195,7 +195,7 @@ const KnotParts: React.FC = ({ return ( <> {/* Статус выбранных деталей */} - {selectedParts.size > 0 && ( + {/* {selectedParts.size > 0 && (
@@ -209,7 +209,7 @@ const KnotParts: React.FC = ({
- )} + )} */}
{parts.map((part, idx) => { @@ -226,11 +226,11 @@ const KnotParts: React.FC = ({ return (
handlePartClick(part)} @@ -240,13 +240,13 @@ const KnotParts: React.FC = ({ >
{part.codeonimage || idx + 1}
-
{part.oem}
+
{part.oem}
-
+
{part.name}
@@ -279,82 +279,45 @@ const KnotParts: React.FC = ({ {/* Красивый тултип с информацией о детали */} {showTooltip && tooltipPart && (
-
- {/* Стрелка тултипа */} -
- - {/* Заголовок */} -
-
- - - -
-
-

{tooltipPart.name}

- {tooltipPart.oem && ( -
- OEM - {tooltipPart.oem} -
- )} -
-
- - {/* Контент */} -
- {tooltipPart.attributes && tooltipPart.attributes.length > 0 ? ( -
-
- - - - Характеристики -
-
- {tooltipPart.attributes.map((attr: any, index: number) => ( -
-
{attr.name || attr.key}
-
{attr.value}
-
- ))} -
-
- ) : ( -
-
- - - -
-
-
Дополнительная информация
-
недоступна
-
-
- )} - - {tooltipPart.note && ( -
-
- - - - Примечание -
-
{tooltipPart.note}
-
+
+ {/* Заголовок и OEM */} +
+
{tooltipPart.name}
+ {tooltipPart.oem && ( +
OEM: {tooltipPart.oem}
)}
+ {/* Характеристики */} + {tooltipPart.attributes && tooltipPart.attributes.length > 0 ? ( + tooltipPart.attributes.map((attr: any, idx: number) => ( +
+
+ {attr.name || attr.key} +
+
+ {attr.value} +
+
+ )) + ) : ( +
+
Дополнительная информация недоступна
+
+ )} + {tooltipPart.note && ( +
+
Примечание
+
{tooltipPart.note}
+
+ )}
)} diff --git a/src/components/vin/VehicleAttributesTooltip.tsx b/src/components/vin/VehicleAttributesTooltip.tsx new file mode 100644 index 0000000..e87ab43 --- /dev/null +++ b/src/components/vin/VehicleAttributesTooltip.tsx @@ -0,0 +1,63 @@ +import React from 'react'; + +interface VehicleAttribute { + key: string; + name: string; + value: string; +} + +interface VehicleAttributesTooltipProps { + show: boolean; + position: { x: number; y: number }; + vehicleName?: string; + vehicleAttributes: VehicleAttribute[]; + onMouseEnter?: () => void; + onMouseLeave?: () => void; + imageUrl?: string; // опционально, для будущего +} + +const VehicleAttributesTooltip: React.FC = ({ + show, + position, + vehicleAttributes, + onMouseEnter, + onMouseLeave, + imageUrl, +}) => { + if (!show) return null; + return ( +
+ {/* Фоновое изображение, если будет нужно */} + {imageUrl && ( + vehicle background + )} +
+ {vehicleAttributes.map((attr, idx) => ( +
+
+ {attr.name} +
+
+ {attr.value} +
+
+ ))} +
+
+ ); +}; + +export default VehicleAttributesTooltip; \ No newline at end of file diff --git a/src/pages/search.tsx b/src/pages/search.tsx index 7d1d07c..d25bbab 100644 --- a/src/pages/search.tsx +++ b/src/pages/search.tsx @@ -199,7 +199,7 @@ const SearchPage = () => {