turash/bugulma/frontend/components/map/MapSidebar.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

56 lines
1.9 KiB
TypeScript

import React from 'react';
import { useTranslation } from '@/hooks/useI18n.tsx';
import Button from '@/components/ui/Button.tsx';
import MapFilters from '@/components/map/MapFilters.tsx';
import SidebarContent from '@/components/map/SidebarContent.tsx';
import { useMapUI, useMapInteraction, useMapActions } from '@/contexts/MapContexts.tsx';
import { ArrowLeft } from 'lucide-react';
const MapSidebar = () => {
const { t } = useTranslation();
const { isSidebarOpen } = useMapUI();
const { selectedOrg, selectedLandmark } = useMapInteraction();
const { handleSelectOrg, handleSelectLandmark } = useMapActions();
const sidebarClasses = `
bg-background border-r flex flex-col
fixed md:relative inset-y-0 left-0 z-30
w-full max-w-[calc(100%-2rem)] sm:max-w-sm
transition-transform duration-300 ease-in-out md:transition-[width]
${isSidebarOpen ? 'translate-x-0' : '-translate-x-full'}
md:transform-none md:min-w-0 md:shrink-0
${isSidebarOpen ? 'md:w-96' : 'md:w-0 md:border-r-0 md:overflow-hidden'}
`;
return (
<aside id="map-sidebar" className={sidebarClasses}>
{/* Wrapper to contain content and handle overflow, especially for w-0 state */}
<div
className={`w-full h-full flex flex-col overflow-hidden ${isSidebarOpen ? 'md:w-96' : 'md:w-0 md:pointer-events-none'}`}
>
{!selectedOrg && !selectedLandmark ? (
<MapFilters />
) : (
<div className="p-4 border-b">
<Button
variant="outline"
onClick={() => {
handleSelectOrg(null);
handleSelectLandmark(null);
}}
>
<ArrowLeft className="h-4 mr-2 text-current w-4" />
{t('mapSidebar.backToList')}
</Button>
</div>
)}
{/* Content */}
<SidebarContent />
</div>
</aside>
);
};
export default React.memo(MapSidebar);