import type { TourStepProps } from 'antd';
import type { TourStepContext } from '../types';
import { domTarget } from '../types';

export function mapLocationsSteps(ctx: TourStepContext): TourStepProps[] {
  if (ctx.settings.enableMap === false) {
    return [];
  }

  return [
    {
      title: 'Map Module',
      description:
        'The Map module manages geographic locations for door-to-door canvassing, event planning, and supporter tracking.',
      target: null,
    },
    {
      title: 'Locations Table',
      description:
        'Each row is an address with data: support level, contact info, building type, and notes from canvassers. Click a row to see full details.',
      target: domTarget('[data-tour-map-table]'),
      placement: 'bottom',
    },
    {
      title: 'Add Locations',
      description:
        'Add locations one at a time, or use CSV import to bulk-upload hundreds of addresses. Geocoding runs automatically to place them on the map.',
      target: domTarget('[data-tour-map-add]'),
      placement: 'bottom',
    },
    {
      title: 'Search & Filter',
      description:
        'Filter locations by support level, area, tags, or address text. Use the map view toggle to see locations plotted geographically.',
      target: domTarget('[data-tour-map-filters]'),
      placement: 'bottom',
    },
    {
      title: 'Canvass Areas',
      description:
        'Organize locations into geographic areas called \'cuts\' for canvassing routes. Areas can be drawn on the map and assigned to volunteers for shift-based door-knocking.',
      target: null,
    },
    {
      title: 'Data Quality',
      description:
        'The Data Quality dashboard (under Map menu) flags duplicates, missing geocodes, and data issues so you can keep your location database clean.',
      target: null,
    },
  ];
}
