/**
 * Delete Modal Configuration
 * Dynamic delete confirmation modal content based on current page/table type
 */

export interface DeleteModalConfig {
  title: string; // e.g., "Delete Keywords" or "Delete Cluster"
  singleItemMessage: string; // Message for single item deletion
  multipleItemsMessage: (count: number) => string; // Message for multiple items (receives count)
  itemNameSingular: string; // e.g., "keyword", "cluster"
  itemNamePlural: string; // e.g., "keywords", "clusters"
}

export const deleteModalConfigs: Record<string, DeleteModalConfig> = {
  '/planner/keywords': {
    title: 'Delete Keywords',
    singleItemMessage: 'You are about to delete this keyword. This action cannot be undone.',
    multipleItemsMessage: (count: number) => `You are deleting ${count} keywords. This action cannot be undone.`,
    itemNameSingular: 'keyword',
    itemNamePlural: 'keywords',
  },
  '/planner/clusters': {
    title: 'Delete Clusters',
    singleItemMessage: 'You are about to delete this cluster. All associated keywords will remain but will no longer be grouped under this cluster.',
    multipleItemsMessage: (count: number) => `You are deleting ${count} clusters. All associated keywords will remain but will no longer be grouped under these clusters.`,
    itemNameSingular: 'cluster',
    itemNamePlural: 'clusters',
  },
  '/planner/ideas': {
    title: 'Delete Ideas',
    singleItemMessage: 'You are about to delete this idea. This action cannot be undone.',
    multipleItemsMessage: (count: number) => `You are deleting ${count} ideas. This action cannot be undone.`,
    itemNameSingular: 'idea',
    itemNamePlural: 'ideas',
  },
  '/writer/tasks': {
    title: 'Delete Tasks',
    singleItemMessage: 'You are about to delete this task. This action cannot be undone.',
    multipleItemsMessage: (count: number) => `You are deleting ${count} tasks. This action cannot be undone.`,
    itemNameSingular: 'task',
    itemNamePlural: 'tasks',
  },
  '/writer/content': {
    title: 'Delete Drafts',
    singleItemMessage: 'You are about to delete this draft. This action cannot be undone.',
    multipleItemsMessage: (count: number) => `You are deleting ${count} drafts. This action cannot be undone.`,
    itemNameSingular: 'draft',
    itemNamePlural: 'drafts',
  },
  '/writer/published': {
    title: 'Delete Published Content',
    singleItemMessage: 'You are about to delete this published content. This action cannot be undone.',
    multipleItemsMessage: (count: number) => `You are deleting ${count} published content items. This action cannot be undone.`,
    itemNameSingular: 'published content',
    itemNamePlural: 'published content items',
  },
};

/**
 * Get delete modal config for a given route
 */
export function getDeleteModalConfig(route: string): DeleteModalConfig | null {
  return deleteModalConfigs[route] || null;
}

