import React from 'react';
import { ArrowRight } from 'lucide-react';
import { Link } from 'react-router-dom';
import { SERVICES } from '../constants';
import { useLocation } from 'react-router-dom';
const Services: React.FC = () => {
const location = useLocation();
const isEnglish = location.pathname.startsWith('/en');
const prefix = isEnglish ? '/en' : '';
// Exclude Technical Tasks and show first 3 actual services
const actualServices = SERVICES.filter(service => service.title !== 'Технические задания');
const displayedServices = actualServices.slice(0, 3);
// Helper function to get service detail page URL
const getServiceUrl = (title: string) => {
const urlMap: { [key: string]: string } = {
'Инженерные изыскания': '/services/surveying',
'Проектирование': '/services/design',
'Обследование грунтов': '/services/soil-survey',
'Обследование здания': '/services/building-survey',
'Землестроительный и Кадастровые работы': '/services/land-survey'
};
return urlMap[title] || null;
};
return (
{isEnglish ? 'Services' : 'Услуги'}
{isEnglish ? 'Show all' : 'Показать все'}
{displayedServices.map((service, idx) => {
const detailUrl = getServiceUrl(service.title);
const title =
isEnglish
? (() => {
switch (service.title) {
case 'Инженерные изыскания':
return 'Engineering surveys';
case 'Проектирование':
return 'Design';
case 'Обследование грунтов':
return 'Soil investigation';
case 'Обследование здания':
return 'Building survey';
default:
return service.title;
}
})()
: service.title;
const description =
isEnglish
? (() => {
switch (service.title) {
case 'Инженерные изыскания':
return 'Comprehensive investigation of construction site conditions: engineering-geodetic, geological, hydrometeorological and environmental surveys.';
case 'Проектирование':
return 'Development of design and working documentation for civil and industrial facilities with architectural and structural solutions.';
case 'Обследование грунтов':
return 'Laboratory and field testing of soils. Determination of physical and mechanical properties for designing foundations and subgrades.';
case 'Обследование здания':
return 'Technical inspection of buildings and structures, assessment of load-bearing elements and recommendations for strengthening.';
default:
return service.description;
}
})()
: service.description;
return (