import React from 'react'; import { useTranslation } from '@/hooks/useI18n.tsx'; import { useDynamicSectors } from '@/hooks/useDynamicSectors.ts'; import SectionHeader from '@/components/layout/SectionHeader.tsx'; import { Container, Grid } from '@/components/ui/layout'; import SectorCard from '@/components/landing/SectorCard.tsx'; interface SectorsProps { onNavigateToMap: (sector?: string) => void; } const Sectors = ({ onNavigateToMap }: SectorsProps) => { const { t } = useTranslation(); const { sectors: dynamicSectors, isLoading, error } = useDynamicSectors(6); return (
{isLoading ? ( // Loading state - show skeleton placeholders Array.from({ length: 6 }, (_, i) => (
)) ) : error ? ( // Error state - show error message

{t('common.error')}

) : dynamicSectors.length === 0 ? ( // Empty state - show loading until data arrives

Loading sectors...

) : ( // Success state - use dynamic sectors dynamicSectors.map((sector) => ( )) )}
); }; export default React.memo(Sectors);