turash/bugulma/frontend/components/landing/Sectors.tsx
Damir Mukimov 6347f42e20
Consolidate repositories: Remove nested frontend .git and merge into main repository
- Remove nested git repository from bugulma/frontend/.git
- Add all frontend files to main repository tracking
- Convert from separate frontend/backend repos to unified monorepo
- Preserve all frontend code and development history as tracked files
- Eliminate nested repository complexity for simpler development workflow

This creates a proper monorepo structure with frontend and backend
coexisting in the same repository for easier development and deployment.
2025-11-25 06:02:57 +01:00

59 lines
2.1 KiB
TypeScript

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 (
<section
className="bg-muted/50 min-h-screen flex items-center scroll-snap-align-start"
aria-labelledby="sectors-title"
>
<Container className="py-16 sm:py-24 w-full">
<SectionHeader
id="sectors-title"
title={t('sectors.title')}
subtitle={t('sectors.subtitle')}
className="mb-12 sm:mb-16"
/>
<Grid cols={{ sm: 2, lg: 4 }} gap="lg">
{isLoading ? (
// Loading state - show skeleton placeholders
Array.from({ length: 6 }, (_, i) => (
<div key={i} className="animate-pulse">
<div className="bg-muted rounded-lg p-6 h-32"></div>
</div>
))
) : error ? (
// Error state - show error message
<div className="col-span-full text-center py-8">
<p className="text-muted-foreground">{t('common.error')}</p>
</div>
) : dynamicSectors.length === 0 ? (
// Empty state - show loading until data arrives
<div className="col-span-full text-center py-8">
<p className="text-muted-foreground">Loading sectors...</p>
</div>
) : (
// Success state - use dynamic sectors
dynamicSectors.map((sector) => (
<SectorCard key={sector.backendName} sector={sector} onNavigateToMap={onNavigateToMap} />
))
)}
</Grid>
</Container>
</section>
);
};
export default React.memo(Sectors);