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

export function userManagementSteps(_ctx: TourStepContext): TourStepProps[] {
  return [
    {
      title: 'User Management',
      description:
        'This page manages everyone who can log into your platform — administrators, content editors, and volunteers.',
      target: null,
    },
    {
      title: 'User Table',
      description:
        'The table shows all registered users with their roles, status, and last login. Use the search bar and filters to find specific users.',
      target: domTarget('[data-tour-users-table]'),
      placement: 'bottom',
    },
    {
      title: 'Create a User',
      description:
        'Create new users here. Set their name, email, role, and initial password. Users receive a welcome email if email is configured.',
      target: domTarget('[data-tour-users-create]'),
      placement: 'bottom',
    },
    {
      title: 'Roles',
      description:
        'Roles control access: SUPER_ADMIN has full control. Module-specific admins (INFLUENCE_ADMIN, MAP_ADMIN, MEDIA_ADMIN) can only manage their area. USER and TEMP roles are for volunteers.',
      target: null,
    },
    {
      title: 'User Status',
      description:
        'Users can be Active, Pending (awaiting approval), Suspended, or Expired. Control access without deleting accounts.',
      target: domTarget('[data-tour-users-status]'),
      placement: 'right',
    },
    {
      title: 'Service Accounts',
      description:
        'When enabled in Settings, new users are automatically provisioned accounts in connected services like Gitea, Vaultwarden, and Listmonk.',
      target: null,
    },
  ];
}
