import React from 'react'; import { useSelector } from 'react-redux'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '../../ui/card'; import { Button } from '../../ui/button'; import { Badge } from '../../ui/badge'; import { ScrollArea } from '../../ui/scroll-area'; import { Label } from '../../ui/label'; import { Globe, Plus, Edit2, UserCog, Mail, Users, MapPin } from 'lucide-react'; import { RootState } from '../../../store'; interface ZoneDetailsProps { selectedZone: string; onAddZone: () => void; onEditZone: (zone: any) => void; } export const ZoneDetails: React.FC = ({ selectedZone, onAddZone, onEditZone }) => { const { zones } = useSelector((state: RootState) => state.master); const filteredZones = zones.filter(z => selectedZone === 'all' || z.id === selectedZone); return (
Zone Details Geographical coverage and state mappings for each zone
{filteredZones.map((zone) => (

{zone.name}

{zone.code}

{zone.description && (

{zone.description}

)}
{zone.states.map((state: string, idx: number) => ( {state} ))}
{zone.zonalBusinessHead && zone.zonalBusinessHead.name && (
{zone.zonalBusinessHead.name}
{zone.zonalBusinessHead.email && (
{zone.zonalBusinessHead.email}
)} {zone.zonalBusinessHead.phone && (
{zone.zonalBusinessHead.phone}
)}
)} {zone.zonalManagers && zone.zonalManagers.length > 0 && (
{zone.zonalManagers.map((zm: any, idx: number) => (
{zm.name} ZM-{idx + 1}
{zm.email && (
{zm.email}
)} {zm.phone && (
{zm.phone}
)} {zm.districts && zm.districts.length > 0 && (
{zm.districts.map((district: string, dIdx: number) => ( {district} ))}
)}
))}
)}
))}
); };